MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / keyMutexIndex

Function keyMutexIndex

lists.go:24–28  ·  view source on GitHub ↗

keyMutexIndex calculates mutex index based on key

(key []byte)

Source from the content-addressed store, hash-verified

22
23// Global mutex for same source/destination RPOPLPUSH operations
24var sameKeyMutex sync.Mutex
25
26// keyMutexIndex calculates mutex index based on key
27func keyMutexIndex(key []byte) uint32 {
28 h := fnv.New32a()
29 h.Write(key)
30 return h.Sum32() % mutexCount
31}

Callers 1

cmdRPOPLPUSHFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected