Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

取消任务之后,任务线程不会取消 #4

Open
FLYyyyy2016 opened this issue Nov 4, 2019 · 0 comments
Open

取消任务之后,任务线程不会取消 #4

FLYyyyy2016 opened this issue Nov 4, 2019 · 0 comments

Comments

@FLYyyyy2016
Copy link

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)
		}()

这里一直等待,不会回收线程。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant