diff --git a/dbpool.go b/dbpool.go index 67b5671..768e021 100644 --- a/dbpool.go +++ b/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() } }