}
new := old + mutexRef
if new&mutexRefMask == 0 {
- panic("net: inconsistent fdMutex")
+ panic("inconsistent poll.fdMutex")
}
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
return true
// Mark as closed and acquire a reference.
new := (old | mutexClosed) + mutexRef
if new&mutexRefMask == 0 {
- panic("net: inconsistent fdMutex")
+ panic("inconsistent poll.fdMutex")
}
// Remove all read and write waiters.
new &^= mutexRMask | mutexWMask
for {
old := atomic.LoadUint64(&mu.state)
if old&mutexRefMask == 0 {
- panic("net: inconsistent fdMutex")
+ panic("inconsistent poll.fdMutex")
}
new := old - mutexRef
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
// Lock is free, acquire it.
new = (old | mutexBit) + mutexRef
if new&mutexRefMask == 0 {
- panic("net: inconsistent fdMutex")
+ panic("inconsistent poll.fdMutex")
}
} else {
// Wait for lock.
new = old + mutexWait
if new&mutexMask == 0 {
- panic("net: inconsistent fdMutex")
+ panic("inconsistent poll.fdMutex")
}
}
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
for {
old := atomic.LoadUint64(&mu.state)
if old&mutexBit == 0 || old&mutexRefMask == 0 {
- panic("net: inconsistent fdMutex")
+ panic("inconsistent poll.fdMutex")
}
// Drop lock, drop reference and wake read waiter if present.
new := (old &^ mutexBit) - mutexRef