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

Avoid race condition on conditional variable #602

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kushalbabel
Copy link

cannot assume that the if condition is true when Wait returns. always best to check in a while loop to avoid race condition.

cannot assume that the if condition is true when Wait returns.
best to check in a while loop to avoid race condition.
@kushalbabel kushalbabel marked this pull request as draft April 10, 2024 19:21
@kushalbabel kushalbabel marked this pull request as ready for review April 10, 2024 19:21
@ralexstokes
Copy link
Collaborator

I think you would also need to read the counter again to get the updated value

@kushalbabel
Copy link
Author

Oh yes, that's right.

@metachris metachris requested a review from Ruteri April 11, 2024 18:51
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.

2 participants