-
Notifications
You must be signed in to change notification settings - Fork 10
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
Change notification of waiting threads in condition_variable
#998
Change notification of waiting threads in condition_variable
#998
Conversation
cscs-ci run ci-on-merge |
5012a35
to
ce75fcf
Compare
cscs-ci run ci-on-merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM thanks!
The test failure ( |
Clariden CI jobs are not running currently due to maintenance, merging manually. All other jobs finished successfully on the latest run. |
#689 was a bit too eager in relaxing locks in
condition_variable
. Thread sanitizer reported a race betweenwait
checking if theagent_ref
had already been reset by notify, andnotify_all
resetting theagent_ref
. The latter was happening without a lock (after #689). This PR slightly rearrangesnotify_all
(and hopefully simplifies it as well). The lock is now held while working on the queue and the individual entries, but released when resuming a thread.This is reported as the following race by thread sanitizer: