Skip to content

Commit 5325528

Browse files
committed
Add comment
1 parent 9d120b0 commit 5325528

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

system/include/emscripten/wasm_worker.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ void emscripten_lock_busyspin_waitinf_acquire(emscripten_lock_t *lock __attribut
188188
// NOTE: This function can be called in both main thread and in Workers. If you
189189
// use this API in Worker, you cannot utilise an infinite loop programming
190190
// model.
191+
// NOTE 2: This function will always acquire the lock asynchronously. That is,
192+
// the lock will only be attempted to acquire after current control flow
193+
// yields back to the browser, so that the Wasm call stack is empty.
194+
// This is to guarantee an uniform control flow.
191195
void emscripten_lock_async_acquire(emscripten_lock_t *lock __attribute__((nonnull)),
192196
emscripten_async_wait_volatile_callback_t asyncWaitFinished __attribute__((nonnull)),
193197
void *userData,

0 commit comments

Comments
 (0)