Unlock at specific points instead of deferring
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
bd543f1345
commit
87b1cc6637
|
@ -258,12 +258,13 @@ func (d *Dispatcher) Stop() {
|
|||
return
|
||||
}
|
||||
d.mtx.Lock()
|
||||
defer d.mtx.Unlock()
|
||||
if d.cancel == nil {
|
||||
d.mtx.Unlock()
|
||||
return
|
||||
}
|
||||
d.cancel()
|
||||
d.cancel = nil
|
||||
d.mtx.Unlock()
|
||||
|
||||
<-d.done
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue