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,
|
nextTimeCb func() int64,
|
||||||
nextRoundCb func() int64,
|
nextRoundCb func() int64,
|
||||||
doCb func(*DataSet) bool) {
|
doCb func(*DataSet) bool) {
|
||||||
newDataCond := sync.NewCond(new(sync.Mutex))
|
cond := sync.NewCond(new(sync.Mutex))
|
||||||
chTimer := make(chan int64)
|
chTimer := make(chan int64)
|
||||||
go this.discoverNewData(dataSource, watchTable, watchTimeCb, newDataCond)
|
go this.discoverNewData(dataSource, watchTable, watchTimeCb, cond)
|
||||||
go q5.CreateCondTimer(chTimer, newDataCond)
|
go q5.CreateCondTimer(chTimer, cond, 10)
|
||||||
|
|
||||||
var lastIdx int64
|
var lastIdx int64
|
||||||
for true {
|
for true {
|
||||||
@ -177,9 +177,9 @@ func (this *dbPool) LoopLoad(
|
|||||||
lastIdx = 0
|
lastIdx = 0
|
||||||
chTimer <- nextRoundCb()
|
chTimer <- nextRoundCb()
|
||||||
}
|
}
|
||||||
newDataCond.L.Lock()
|
cond.L.Lock()
|
||||||
newDataCond.Wait()
|
cond.Wait()
|
||||||
newDataCond.L.Unlock()
|
cond.L.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user