MCPcopy Index your code
hub / github.com/Cyinx/einx / GetOne

Method GetOne

queue/rw_queue.go:80–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78}
79
80func (this *RWQueue) GetOne() interface{} {
81 this.read_lock.Lock()
82 defer this.read_lock.Unlock()
83
84 if this.read_queue.empty() == true {
85 this.write_lock.Lock()
86 if this.exchange() == false {
87 this.write_lock.Unlock()
88 return 0
89 }
90 this.write_lock.Unlock()
91 }
92
93 read_queue := this.read_queue
94 val, ret := read_queue.pop()
95 if ret == false {
96 return nil
97 }
98 return val
99}
100
101func (this *RWQueue) Empty() bool {
102 this.read_lock.Lock()

Callers

nothing calls this directly

Calls 5

exchangeMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80
emptyMethod · 0.80
popMethod · 0.80

Tested by

no test coverage detected