fix data race

master v1.0.2
kevin 4 years ago
parent 6fdee77fa9
commit a3d7474ae0

@ -139,9 +139,7 @@ func (pe *PeriodicalExecutor) executeTasks(tasks interface{}) bool {
pe.wgBarrier.Guard(func() { pe.wgBarrier.Guard(func() {
pe.waitGroup.Add(1) pe.waitGroup.Add(1)
}) })
defer pe.wgBarrier.Guard(func() { defer pe.waitGroup.Done()
pe.waitGroup.Done()
})
ok := pe.hasTasks(tasks) ok := pe.hasTasks(tasks)
if ok { if ok {

Loading…
Cancel
Save