forked from TrueCloudLab/neoneo-go
oracle: make double-Shutdown a no-op
This commit is contained in:
parent
6b2fc5e056
commit
cab633ffed
1 changed files with 6 additions and 0 deletions
|
@ -181,6 +181,12 @@ func (o *Oracle) Name() string {
|
||||||
|
|
||||||
// Shutdown shutdowns Oracle.
|
// Shutdown shutdowns Oracle.
|
||||||
func (o *Oracle) Shutdown() {
|
func (o *Oracle) Shutdown() {
|
||||||
|
o.respMtx.Lock()
|
||||||
|
defer o.respMtx.Unlock()
|
||||||
|
if !o.running {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
o.running = false
|
||||||
close(o.close)
|
close(o.close)
|
||||||
o.getBroadcaster().Shutdown()
|
o.getBroadcaster().Shutdown()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue