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

Fix: Wait for terminated threads to join in thread_pool::Impl::resize #3879

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

LazyDodo
Copy link
Contributor

Description

Part of solving #3851.

When decreasing the number of threads in thread_pool::Impl::resize it was possible for the threads marked for termination to still be fully alive at process exit time if the call to resize and the exit of the main function were close enough to each other.

This change makes resize wait for the threads to actually join guaranteeing the threads have been shut down in a orderly manner when the resize function exits.

Tests

N/A

Checklist:

  • I have read the contribution guidelines.
  • If this is more extensive than a small change to existing code, I
    have previously submitted a Contributor License Agreement
    (individual, and if there is any way my
    employers might think my programming belongs to them, then also
    corporate). - small change no CLA required.
  • I have updated the documentation, if applicable. - N/A
  • I have ensured that the change is tested somewhere in the testsuite N/A
    (adding new test cases if necessary).
  • My code follows the prevailing code style of this project. - Just moved code around should have no style issues

Part of solving AcademySoftwareFoundation#3851.

When decreasing the number of threads in `thread_pool::Impl::resize`
it was possible for the threads marked for termination to still be
fully alive at process exit time if the call to `resize` and the exit
of the main function were close enough to each other.

This change makes `resize` wait for the threads to actually join
guaranteeing the threads have been shut down in a orderly manner
when the `resize` function exits.
@lgritz lgritz merged commit 2abd946 into AcademySoftwareFoundation:master Jun 12, 2023
22 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants