diff --git a/src/sync/poolqueue.go b/src/sync/poolqueue.go index cda08a0b21..4422ee7c19 100644 --- a/src/sync/poolqueue.go +++ b/src/sync/poolqueue.go @@ -80,7 +80,7 @@ func (d *poolDequeue) pack(head, tail uint32) uint64 { func (d *poolDequeue) pushHead(val interface{}) bool { ptrs := atomic.LoadUint64(&d.headTail) head, tail := d.unpack(ptrs) - if tail+uint32(len(d.vals)) == head { + if (tail+uint32(len(d.vals)))&(1<