Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
19
func
(sm *shardedRWMutex) Lock(key string) {
20
idx := hash(key) % uint32(len(sm.mu))
21
sm.mu[idx].Lock()
22
}
23
24
func
(sm *shardedRWMutex) Unlock(key string) {
25
idx := hash(key) % uint32(len(sm.mu))
Callers
15
Enqueue
Method · 0.80
Len
Method · 0.80
Peek
Method · 0.80
Reset
Method · 0.80
Remove
Method · 0.80
GetAll
Method · 0.80
Dequeue
Method · 0.80
Len
Method · 0.80
Peek
Method · 0.80
Reset
Method · 0.80
GetAll
Method · 0.80
Remove
Method · 0.80
Calls
1
hash
Function · 0.85
Tested by
3
TestEventEmitter_SubscribeUnsubscribe
Function · 0.64
TestEventEmitter_Clear
Function · 0.64
TestEventEmitter_ConcurrentAccess
Function · 0.64