-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use an AtomicPtr for PulseStream's drain_timer
There is a race condition between `drained_cb` and `PulseStream::stop` that happens reliably on Firefox CI with rust 1.56 beta (LLVM 13) and PGO instrumentation. Here's how it goes: - in the Firefox AudioIPC Server RPC thread, `PulseStream::stop` is called - `PulseStream::stop enters the loop waiting for drain, and blocks on `mainloop.wait` - Later, some other thread calls `drained_cb`, which resets `drain_timer`, and signals the mainloop. - Back the other AudioIPC Server RPC thread, `mainloop.wait` returns, looping back to the test for `drain_timer`... which this thread doesn't know had been updated yet, so it blocks on `mainloop.wait` again.
- Loading branch information
Showing
1 changed file
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters