1
0
mirror of https://github.com/golang/go synced 2024-11-08 04:56:16 -07:00
This commit is contained in:
ZhangYunHao 2020-10-13 17:49:27 +08:00
parent 83090ad6d5
commit a2f1235758

View File

@ -80,7 +80,7 @@ func (d *poolDequeue) pack(head, tail uint32) uint64 {
func (d *poolDequeue) pushHead(val interface{}) bool { func (d *poolDequeue) pushHead(val interface{}) bool {
ptrs := atomic.LoadUint64(&d.headTail) ptrs := atomic.LoadUint64(&d.headTail)
head, tail := d.unpack(ptrs) head, tail := d.unpack(ptrs)
if tail+uint32(len(d.vals)) == head { if (tail+uint32(len(d.vals)))&(1<<dequeueBits-1) == head{
// Queue is full. // Queue is full.
return false return false
} }