mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
优化rpc超时-使用时间轮定时器
This commit is contained in:
@@ -109,6 +109,10 @@ type Timer struct {
|
||||
//停止停时器
|
||||
func (timer *Timer) Close(){
|
||||
timer.bClose = true
|
||||
if timer.bClose == true {
|
||||
return
|
||||
}
|
||||
|
||||
//将关闭标志设为1关闭状态
|
||||
if atomic.SwapInt32(&timer.end,1) == 0 {
|
||||
chanStopTimer<-timer
|
||||
|
||||
Reference in New Issue
Block a user