timer.C这个chan在CancelJob之后没有关闭。
timer.Stop函数官方注释表示“ Stop does not close the channel”,所以导致
go func() {
// wait...
//but if job cancel,con't recive anything;
<-j.JTimer.timer.C
// run job function
j.run()
// set job done
jobSet.setJobDone(j.ID)
}()
这里一直等待,不会回收线程。
timer.C这个chan在CancelJob之后没有关闭。
timer.Stop函数官方注释表示“ Stop does not close the channel”,所以导致
这里一直等待,不会回收线程。