1
This commit is contained in:
parent
71fae94866
commit
2ff2d1c71b
12
dbpool.go
12
dbpool.go
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user