Prevent joining detached thread in ThreadPoolImpl (#8635)#23
Open
limowang wants to merge 1 commit into
Open
Conversation
对应社区 commit:facebook@23ffed9 Summary: This draining mechanism should not be run during `JoinThreads()` because it can detach threads that will be joined. Joining detached threads would throw an exception. With this PR, we skip draining when `JoinThreads()` has already decided what threads to `join()`, so the threads will exit naturally once the work queue empties. Pull Request resolved: facebook#8635 Test Plan: verified it unblocked using `WaitForJobsAndJoinAllThreads()` in facebook#8611. Reviewed By: riversand963 Differential Revision: D30174587 Pulled By: ajkr fbshipit-source-id: 144966398a607987e0763c7152a0f653fdbf3c8b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
对应社区 commit:facebook@23ffed9
Summary:
This draining mechanism should not be run during
JoinThreads()because it can detach threads that will be joined. Joining detached threads would throw an exception.With this PR, we skip draining when
JoinThreads()has already decided what threads tojoin(), so the threads will exit naturally once the work queue empties.Pull Request resolved: facebook#8635
Test Plan: verified it unblocked using
WaitForJobsAndJoinAllThreads()in facebook#8611.Reviewed By: riversand963
Differential Revision: D30174587
Pulled By: ajkr
fbshipit-source-id: 144966398a607987e0763c7152a0f653fdbf3c8b