mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
新增时间轮定时器
This commit is contained in:
@@ -138,13 +138,15 @@ func (slf *Service) Run() {
|
||||
analyzer = nil
|
||||
}
|
||||
case t := <- slf.dispatcher.ChanTimer:
|
||||
if slf.profiler!=nil {
|
||||
analyzer = slf.profiler.Push(fmt.Sprintf("Timer_%s", t.GetFunctionName()))
|
||||
}
|
||||
t.Cb()
|
||||
if analyzer!=nil {
|
||||
analyzer.Pop()
|
||||
analyzer = nil
|
||||
if t.IsStop() == false {
|
||||
if slf.profiler != nil {
|
||||
analyzer = slf.profiler.Push(fmt.Sprintf("Timer_%s", t.AdditionData.(*timer.Timer).GetFunctionName()))
|
||||
}
|
||||
t.AdditionData.(*timer.Timer).Cb()
|
||||
if analyzer != nil {
|
||||
analyzer.Pop()
|
||||
analyzer = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user