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

Close func may cause a panic #8

Open
PursuingPing opened this issue Sep 17, 2023 · 1 comment
Open

Close func may cause a panic #8

PursuingPing opened this issue Sep 17, 2023 · 1 comment

Comments

@PursuingPing
Copy link

//TODO: need to check the existing /running task before closing the threadpool

@PursuingPing
Copy link
Author

PursuingPing commented Sep 17, 2023

And the threadPool close func has a problem in this scenario if the close func is called and the theaterPool is closed and thecase job := <-w.jobChannel:at the same time, the return select case may not be picked, so next for range will execute and the worker still can send to the worker channel, and it will panic.
image

image

@PursuingPing PursuingPing changed the title How to imply this? Close func may cause a panic Sep 17, 2023
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