MCPcopy Create free account
hub / github.com/koding/kite / Get

Method Get

kontrol/idlock.go:19–33  ·  view source on GitHub ↗

Get returns a lock that is bound to a specific id.

(id string)

Source from the content-addressed store, hash-verified

17
18// Get returns a lock that is bound to a specific id.
19func (i *IdLock) Get(id string) sync.Locker {
20 i.locksMu.Lock()
21 defer i.locksMu.Unlock()
22
23 var l sync.Locker
24 var ok bool
25
26 l, ok = i.locks[id]
27 if !ok {
28 l = &sync.Mutex{}
29 i.locks[id] = l
30 }
31
32 return l
33}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected