Closed
Description
This example does not exhibit the desired behaviour:
https://doc.rust-lang.org/beta/std/sync/struct.WaitTimeoutResult.html
In the thread, the mutex is locked before waiting and then setting the condition, so wait_timeout
waits until the condition is set (try changing that 20 ms to 1000 ms for dramatic effect). The sleep
should be before the lock and notify.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Rollup merge of rust-lang#48239 - GuillaumeGomez:fix-condvar-example,…
Rollup merge of rust-lang#48239 - GuillaumeGomez:fix-condvar-example,…