audio: Fix locking in backends that manage their own callback threads.

Otherwise you might get a race where an app pauses the device, but
the audio callback still manages to run after the pause is in place.
This commit is contained in:
Ryan C. Gordon
2022-05-20 21:07:25 -04:00
parent a95f5a792c
commit dc62fec5e9
6 changed files with 59 additions and 60 deletions

View File

@@ -28,6 +28,11 @@
#include <emscripten/emscripten.h>
/* !!! FIXME: this currently expects that the audio callback runs in the main thread,
!!! FIXME: in intervals when the application isn't running, but that may not be
!!! FIXME: true always once pthread support becomes widespread. Revisit this code
!!! FIXME: at some point and see what needs to be done for that! */
static void
FeedAudioDevice(_THIS, const void *buf, const int buflen)
{