This commit is contained in:
aozhiwei 2024-06-29 21:03:54 +08:00
parent 71fae94866
commit 2ff2d1c71b

View File

@ -143,10 +143,10 @@ func (this *dbPool) LoopLoad(
nextTimeCb func() int64,
nextRoundCb func() int64,
doCb func(*DataSet) bool) {
newDataCond := sync.NewCond(new(sync.Mutex))
cond := sync.NewCond(new(sync.Mutex))
chTimer := make(chan int64)
go this.discoverNewData(dataSource, watchTable, watchTimeCb, newDataCond)
go q5.CreateCondTimer(chTimer, newDataCond)
go this.discoverNewData(dataSource, watchTable, watchTimeCb, cond)
go q5.CreateCondTimer(chTimer, cond, 10)
var lastIdx int64
for true {
@ -177,9 +177,9 @@ func (this *dbPool) LoopLoad(
lastIdx = 0
chTimer <- nextRoundCb()
}
newDataCond.L.Lock()
newDataCond.Wait()
newDataCond.L.Unlock()
cond.L.Lock()
cond.Wait()
cond.L.Unlock()
}
}