MCPcopy
hub / github.com/garethgeorge/backrest / Lock

Method Lock

internal/logstore/shardedmutex.go:19–22  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

17}
18
19func (sm *shardedRWMutex) Lock(key string) {
20 idx := hash(key) % uint32(len(sm.mu))
21 sm.mu[idx].Lock()
22}
23
24func (sm *shardedRWMutex) Unlock(key string) {
25 idx := hash(key) % uint32(len(sm.mu))

Callers 15

EnqueueMethod · 0.80
LenMethod · 0.80
PeekMethod · 0.80
ResetMethod · 0.80
RemoveMethod · 0.80
GetAllMethod · 0.80
DequeueMethod · 0.80
LenMethod · 0.80
PeekMethod · 0.80
ResetMethod · 0.80
GetAllMethod · 0.80
RemoveMethod · 0.80

Calls 1

hashFunction · 0.85