Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an AtomicPtr for PulseStream's drain_timer #72

Merged
merged 1 commit into from
Oct 15, 2021

Commits on Oct 15, 2021

  1. 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.
    glandium committed Oct 15, 2021
    Configuration menu
    Copy the full SHA
    268bdd5 View commit details
    Browse the repository at this point in the history