Dispatch: Make sure mutex gets unlocked on call to Stop
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
parent
194f1cfd7c
commit
bd543f1345
|
@ -258,12 +258,12 @@ func (d *Dispatcher) Stop() {
|
|||
return
|
||||
}
|
||||
d.mtx.Lock()
|
||||
defer d.mtx.Unlock()
|
||||
if d.cancel == nil {
|
||||
return
|
||||
}
|
||||
d.cancel()
|
||||
d.cancel = nil
|
||||
d.mtx.Unlock()
|
||||
|
||||
<-d.done
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue