WebAssembly / WebAssembly/threads
return status of std::condition_variable wait_for is not always as expected
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 767
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
My application making use of a thread + timer to perform periodical operations in the background stopped working as expected when ported from native C++ (gnu c++) to web assembly.
Simply printing the status returned by
status = m_wait.wait_for(lock, ms);
i realised that from time to time it was 0 (no_timeout) when I expected a timeout.
Is that a possible bug?
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported std::condition_variable::wait_for call, m_wait.wait_for(lock, ms), and compare its return status in native C++ and WebAssembly. Reproduce the periodic thread-and-timer behavior, then read the Threads and Atomics proposal sections covering condition-variable waits. Done means determining whether the no_timeout result violates the expected semantics and documenting a minimal reproduction or confirmed specification issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, wasm
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100