mirror of
https://github.com/golang/go
synced 2024-11-21 23:24:41 -07:00
net: fix bug in fdMutex
Fixes #6165. R=golang-dev, r CC=golang-dev https://golang.org/cl/12984044
This commit is contained in:
parent
b6a8fa100c
commit
727dd08cdf
@ -98,7 +98,7 @@ func (mu *fdMutex) Decref() bool {
|
||||
}
|
||||
new := old - mutexRef
|
||||
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
|
||||
return new&(mutexClosed|mutexRef) == mutexClosed
|
||||
return new&(mutexClosed|mutexRefMask) == mutexClosed
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -174,7 +174,7 @@ func (mu *fdMutex) RWUnlock(read bool) bool {
|
||||
if old&mutexMask != 0 {
|
||||
runtime_Semrelease(mutexSema)
|
||||
}
|
||||
return new&(mutexClosed|mutexRef) == mutexClosed
|
||||
return new&(mutexClosed|mutexRefMask) == mutexClosed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user