Fixing locking in ACN event bus interface
This commit is contained in:
parent
a4e62fe902
commit
41dbd6da39
|
@ -228,12 +228,12 @@ func (ac *applicationCore) GetEventBus(onion string) event.Manager {
|
||||||
func (app *application) getACNStatusHandler() func(int, string) {
|
func (app *application) getACNStatusHandler() func(int, string) {
|
||||||
return func(progress int, status string) {
|
return func(progress int, status string) {
|
||||||
progStr := strconv.Itoa(progress)
|
progStr := strconv.Itoa(progress)
|
||||||
app.peerLock.Lock()
|
app.appmutex.Lock()
|
||||||
app.appBus.Publish(event.NewEventList(event.ACNStatus, event.Progress, progStr, event.Status, status))
|
app.appBus.Publish(event.NewEventList(event.ACNStatus, event.Progress, progStr, event.Status, status))
|
||||||
for _, bus := range app.eventBuses {
|
for _, bus := range app.eventBuses {
|
||||||
bus.Publish(event.NewEventList(event.ACNStatus, event.Progress, progStr, event.Status, status))
|
bus.Publish(event.NewEventList(event.ACNStatus, event.Progress, progStr, event.Status, status))
|
||||||
}
|
}
|
||||||
app.peerLock.Unlock()
|
app.appmutex.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue