1
0
mirror of https://github.com/golang/go synced 2024-11-17 07:45:09 -07:00

sync: remove the redundant logic on sync.(*Pool).Put

When the procUnpin is placed after shared.pushHead, there is
no need for x as a flag to indicate the previous process.

This CL can make the logic clear, and at the same time reduce
a redundant judgment.

Change-Id: I34ec9ba4cb5b5dbdf13a8f158b90481fed248cf5
Reviewed-on: https://go-review.googlesource.com/c/go/+/360059
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Jason7602 2021-11-01 23:27:45 +08:00 committed by Gopher Robot
parent 4c565a5561
commit 507a44dc22

View File

@ -102,9 +102,7 @@ func (p *Pool) Put(x any) {
l, _ := p.pin()
if l.private == nil {
l.private = x
x = nil
}
if x != nil {
} else {
l.shared.pushHead(x)
}
runtime_procUnpin()