Closed Bug 1237414 Opened 7 years ago Closed 7 years ago
Threadrace when starting/stopping cubeb for Audio
AsyncCubebOperation (used for Init and Shutdown of drivers) spawns a new thread at every operation. This is expensive (on Windows), and more importantly the code relies on Shutdown of a previous driver before another driver starts (i.e. reliable serialization). Spawning a thread-per-operation does not provide such a guarantee. The right solution is to use a SharedThreadPool (or even plain nsThreadPool) with a single thread max. It will shut down idle threads and restart them as needed.
Attachment #8704805 - Flags: review?(padenot) → review+
I had to back this (and everything else from this push) out for causing various crashes on WinXP. They all seem to mention "winmm_stream_init" or "cubeb_winmm.c". https://treeherder.mozilla.org/logviewer.html#?job_id=20232505&repo=mozilla-inbound https://hg.mozilla.org/integration/mozilla-inbound/rev/e33cecf8d2a5
You need to log in before you can comment on or make changes to this bug.