mirror of
https://github.com/golang/go
synced 2024-11-19 09:54:49 -07:00
internal/poll: adjust panic messages
Change-Id: Ic9be3249e76da7e86cc41baa88935249a94e4a16 Reviewed-on: https://go-review.googlesource.com/40073 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
423e7e6037
commit
075ee299b1
@ -56,7 +56,7 @@ func (mu *fdMutex) incref() bool {
|
|||||||
}
|
}
|
||||||
new := old + mutexRef
|
new := old + mutexRef
|
||||||
if new&mutexRefMask == 0 {
|
if new&mutexRefMask == 0 {
|
||||||
panic("net: inconsistent fdMutex")
|
panic("inconsistent poll.fdMutex")
|
||||||
}
|
}
|
||||||
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
|
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
|
||||||
return true
|
return true
|
||||||
@ -75,7 +75,7 @@ func (mu *fdMutex) increfAndClose() bool {
|
|||||||
// Mark as closed and acquire a reference.
|
// Mark as closed and acquire a reference.
|
||||||
new := (old | mutexClosed) + mutexRef
|
new := (old | mutexClosed) + mutexRef
|
||||||
if new&mutexRefMask == 0 {
|
if new&mutexRefMask == 0 {
|
||||||
panic("net: inconsistent fdMutex")
|
panic("inconsistent poll.fdMutex")
|
||||||
}
|
}
|
||||||
// Remove all read and write waiters.
|
// Remove all read and write waiters.
|
||||||
new &^= mutexRMask | mutexWMask
|
new &^= mutexRMask | mutexWMask
|
||||||
@ -101,7 +101,7 @@ func (mu *fdMutex) decref() bool {
|
|||||||
for {
|
for {
|
||||||
old := atomic.LoadUint64(&mu.state)
|
old := atomic.LoadUint64(&mu.state)
|
||||||
if old&mutexRefMask == 0 {
|
if old&mutexRefMask == 0 {
|
||||||
panic("net: inconsistent fdMutex")
|
panic("inconsistent poll.fdMutex")
|
||||||
}
|
}
|
||||||
new := old - mutexRef
|
new := old - mutexRef
|
||||||
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
|
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
|
||||||
@ -136,13 +136,13 @@ func (mu *fdMutex) rwlock(read bool) bool {
|
|||||||
// Lock is free, acquire it.
|
// Lock is free, acquire it.
|
||||||
new = (old | mutexBit) + mutexRef
|
new = (old | mutexBit) + mutexRef
|
||||||
if new&mutexRefMask == 0 {
|
if new&mutexRefMask == 0 {
|
||||||
panic("net: inconsistent fdMutex")
|
panic("inconsistent poll.fdMutex")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Wait for lock.
|
// Wait for lock.
|
||||||
new = old + mutexWait
|
new = old + mutexWait
|
||||||
if new&mutexMask == 0 {
|
if new&mutexMask == 0 {
|
||||||
panic("net: inconsistent fdMutex")
|
panic("inconsistent poll.fdMutex")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
|
if atomic.CompareAndSwapUint64(&mu.state, old, new) {
|
||||||
@ -174,7 +174,7 @@ func (mu *fdMutex) rwunlock(read bool) bool {
|
|||||||
for {
|
for {
|
||||||
old := atomic.LoadUint64(&mu.state)
|
old := atomic.LoadUint64(&mu.state)
|
||||||
if old&mutexBit == 0 || old&mutexRefMask == 0 {
|
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.
|
// Drop lock, drop reference and wake read waiter if present.
|
||||||
new := (old &^ mutexBit) - mutexRef
|
new := (old &^ mutexBit) - mutexRef
|
||||||
|
@ -203,7 +203,7 @@ func (s *ioSrv) ExecIO(o *operation, name string, submit func(o *operation) erro
|
|||||||
case ErrClosing, ErrTimeout:
|
case ErrClosing, ErrTimeout:
|
||||||
// will deal with those.
|
// will deal with those.
|
||||||
default:
|
default:
|
||||||
panic("net: unexpected runtime.netpoll error: " + netpollErr.Error())
|
panic("unexpected runtime.netpoll error: " + netpollErr.Error())
|
||||||
}
|
}
|
||||||
// Cancel our request.
|
// Cancel our request.
|
||||||
if canCancelIO {
|
if canCancelIO {
|
||||||
|
Loading…
Reference in New Issue
Block a user