gecko-dev/media/libcubeb
Chun-Min Chang ec036851de Bug 1530715 - P42: Remove unnecessary mutex. r=padenot
There are three potential data-race operations that may run at the same
time:
1. Data callback and stream reinitialization
2. Data callback and stream destroying
3. Stream reinitialization and stream destroying

The case 1 and 2 won't happen as long as the AudioOutputUnitStop is
called at the beginning of stream reinitialization and stream
destorying. The AudioOutputUnitStop requires to lock a mutex inside
CoreAudio framework that is also used by the data callback. Thus, if
there is a running callback, which holds the mutex inside CoreAudio
framework, when AudioOutputUnitStop is called, then the calling will
block the current thread until the data callback ends since it is
waiting for the mutex. By calling AudioOutputUnitStop at the beginning
of the stream reinitialization and stream destroying, the data race of
case 1 and 2 can be avoided.

On the other hand, the case 3 won't happen since the stream
initialization and destroying is run on the same task queue. The two
tasks on the same serial task queue are impossible to be run at the same
time. The mutex in AudioUnitStream is unnecessary because it's used for
the case 3.

Differential Revision: https://phabricator.services.mozilla.com/D34076

--HG--
extra : moz-landing-system : lando
2019-07-10 08:06:56 +00:00
..
cubeb-coreaudio-rs Bug 1530715 - P42: Remove unnecessary mutex. r=padenot 2019-07-10 08:06:56 +00:00
cubeb-pulse-rs Bug 1518106 - Update cubeb-pulse-rs from upstream to 17c1629. r=kinetik 2019-01-23 19:37:18 +00:00
gtest Bug 1318091 - Disable failing android gtests; r=bc 2019-04-08 20:58:21 +00:00
include Bug 1531833 - Update libcubeb to 241e3c (and rebase an in-tree patch). r=kinetik 2019-04-16 15:44:47 +00:00
src Bug 1530715 - P3: Build cubeb-coreaudio-rs in libcubeb. r=kinetik 2019-07-10 08:06:12 +00:00
AUTHORS
disable-assert.patch
LICENSE
moz.build
moz.yaml Bug 1561945 - P2: Update cubeb from upstream to 98a1c8e. r=achronop 2019-06-30 23:36:38 +00:00
README.md
update.sh Bug 1561945 - P1: Copy sunaudio backend to cubeb. r=achronop 2019-06-27 16:59:00 +00:00

Build Status Build status

See INSTALL.md for build instructions.

Licensed under an ISC-style license. See LICENSE for details.