Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix potential race condition in lightweight_manual_reset_event.
Need to hold the mutex while calling `cv.notify_all()` to prevent it from potentially calling `notify_all()` on a destroyed `condition_variable` object. A thread inside `.wait()` might see the write to `m_isSet` after the lock is released within `.set()` but before `notify_all()` is called and then continue executing and go on to destroy the event object (and thus the condition_variable) leaving the thread that is about to call `cv.notify_all()` with a dangling reference.
- Loading branch information