Skip to content

Commit 8dcef4c

Browse files
committed
Added docs (and moved the a spin to happen faster)
1 parent c5ca059 commit 8dcef4c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/webaudio/audioworklet_emscripten_locks.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ bool ProcessAudio(int numInputs, const AudioSampleFrame *inputs, int numOutputs,
7979
emscripten_outf("TEST_WAIT_ACQUIRE_FAIL: %d (expect: 0)", result);
8080
assert(!result);
8181
whichTest = TEST_WAIT_ACQUIRE;
82-
break;
82+
// Fall through here so the worker has a chance to unlock whilst spinning
8383
case TEST_WAIT_ACQUIRE:
8484
// Will get unlocked in worker, so should quickly acquire
8585
result = emscripten_lock_busyspin_wait_acquire(&testLock, 10000);
@@ -107,6 +107,7 @@ bool ProcessAudio(int numInputs, const AudioSampleFrame *inputs, int numOutputs,
107107
emscripten_outf("TEST_GET_NOW: %d (expect: > 0)", result);
108108
assert(result > 0);
109109
whichTest = TEST_DONE;
110+
// Fall through here and stop playback (shutting down in the worker)
110111
case TEST_DONE:
111112
return false;
112113
default:

0 commit comments

Comments
 (0)