MCPcopy
hub / github.com/nats-io/nats.go / CompareAndSwap

Method CompareAndSwap

internal/syncx/map.go:62–64  ·  view source on GitHub ↗
(key K, old, new V)

Source from the content-addressed store, hash-verified

60}
61
62func (m *Map[K, V]) CompareAndSwap(key K, old, new V) bool {
63 return m.m.CompareAndSwap(key, old, new)
64}
65
66func (m *Map[K, V]) CompareAndDelete(key K, value V) bool {
67 return m.m.CompareAndDelete(key, value)

Callers 10

TestMapCompareAndSwapFunction · 0.80
StopMethod · 0.80
DrainMethod · 0.80
ConsumeMethod · 0.80
NextMethod · 0.80
StopMethod · 0.80
DrainMethod · 0.80
closeMsgsMethod · 0.80
StopMethod · 0.80
DrainMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestMapCompareAndSwapFunction · 0.64