MCPcopy
hub / github.com/WireGuard/wireguard-go / Get

Method Get

device/pools.go:26–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26func (p *WaitPool) Get() any {
27 if p.max != 0 {
28 p.lock.Lock()
29 for p.count >= p.max {
30 p.cond.Wait()
31 }
32 p.count++
33 p.lock.Unlock()
34 }
35 return p.pool.Get()
36}
37
38func (p *WaitPool) Put(x any) {
39 p.pool.Put(x)

Callers 13

TestWaitPoolFunction · 0.95
BenchmarkWaitPoolFunction · 0.95
BenchmarkWaitPoolEmptyFunction · 0.95
getMessagesMethod · 0.80
SendMethod · 0.80
mainFunction · 0.80
IpcGetOperationMethod · 0.80
GetMessageBufferMethod · 0.80
GetInboundElementMethod · 0.80
GetOutboundElementMethod · 0.80

Calls 1

WaitMethod · 0.80

Tested by 4

TestWaitPoolFunction · 0.76
BenchmarkWaitPoolFunction · 0.76
BenchmarkWaitPoolEmptyFunction · 0.76
BenchmarkSyncPoolFunction · 0.64