Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

condition_variable_any stuck waiting

Open
#399 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
cpp

Research direction

Start with the Windows condition_variable_any path around interruptible_wait, wake_waiters, total_count, and winapi::ReleaseSemaphore. Reproduce under Boost 1.83.0 with MSVC 19.38.33135.0, then determine why a notified predicate wait can remain blocked and define a reliable fix or diagnostic for the semaphore failure.

Written by the indexing model from the issue text.

Description

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.

Dominant language
C++
Stars
213
Forks
171
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/thread

All issues in boostorg/thread

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.