1
0
mirror of https://github.com/golang/go synced 2024-11-08 02:56:18 -07:00
This commit is contained in:
ZhangYunHao 2020-10-13 17:50:02 +08:00
parent a2f1235758
commit ded020d02c

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)))&(1<<dequeueBits-1) == head{ if (tail+uint32(len(d.vals)))&(1<<dequeueBits-1) == head {
// Queue is full. // Queue is full.
return false return false
} }