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

condition_variable_any stuck waiting #399

Open
JulesRapanga opened this issue Mar 9, 2024 · 0 comments
Open

condition_variable_any stuck waiting #399

JulesRapanga opened this issue Mar 9, 2024 · 0 comments

Comments

@JulesRapanga
Copy link

Boost 1.83.0
MSVC 19.38.33135.0

Occasionally I hit an issue where a boost::condition_variable_any gets stuck during wait() with a predicate, where I know that the predicate evaluates to true and notify_one() has definitely been called multiple times. All that I have to go on is a core dump which as well as showing the above shows that

  • the thread running wait() is in interruptible_wait
  • total_count is 0

So presumably total_count has been decremented in wake_waiters but winapi::ReleaseSemaphore hasn't resulted in the waiting thread resuming. ReleaseSemaphore officially can fail but condition_variable's usage doesn't check the return code. Since total_count is zero subsequent calls to notify will have no effect.
stuck_boost_cv

The same app code runs on linux without hitting this issue.

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