Fix shutdown races
This commit is contained in:
parent
833597b585
commit
ebc7541953
3 changed files with 42 additions and 12 deletions
|
|
@ -377,10 +377,11 @@ func (device *Device) Close() {
|
|||
|
||||
close(device.signals.stop)
|
||||
|
||||
device.RemoveAllPeers()
|
||||
|
||||
device.state.stopping.Wait()
|
||||
device.FlushPacketQueues()
|
||||
|
||||
device.RemoveAllPeers()
|
||||
device.rate.limiter.Close()
|
||||
|
||||
device.state.changing.Set(false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue