mirror of https://github.com/poanetwork/gecko.git
vms: Fix deadlock when stopping timers during spdagvm.VM.Shutdown()
refs #66
This commit is contained in:
parent
996ea99fb1
commit
2e02f6863e
|
@ -134,7 +134,11 @@ func (vm *VM) Shutdown() {
|
|||
return
|
||||
}
|
||||
|
||||
// There is a potential deadlock if the timer is about to execute a timeout.
|
||||
// So, the lock must be released before stopping the timer.
|
||||
vm.ctx.Lock.Unlock()
|
||||
vm.timer.Stop()
|
||||
vm.ctx.Lock.Lock()
|
||||
if err := vm.baseDB.Close(); err != nil {
|
||||
vm.ctx.Log.Error("Closing the database failed with %s", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue