mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
add panic log to Close
This commit is contained in:
parent
d875add9c7
commit
c981cd44ce
1 changed files with 4 additions and 1 deletions
|
|
@ -65,7 +65,10 @@ func (cm *ClosableMutex) Unlock() {
|
|||
// Close locks the mutex, then closes it.
|
||||
func (cm *ClosableMutex) Close() {
|
||||
select {
|
||||
case <-cm.ch:
|
||||
case _, ok := <-cm.ch:
|
||||
if !ok {
|
||||
panic("Close of already-closed ClosableMutex")
|
||||
}
|
||||
default:
|
||||
}
|
||||
close(cm.ch)
|
||||
|
|
|
|||
Loading…
Reference in a new issue