@@ -12,6 +12,11 @@ extern "C" {
12
12
#define emscripten_wasm_worker_t int
13
13
#define EMSCRIPTEN_WASM_WORKER_ID_PARENT 0
14
14
15
+ // Similar to emscripten_async_wait_callback_t but with a volatile first
16
+ // argument.
17
+ typedef void (* emscripten_async_wait_volatile_callback_t )(volatile void * address , uint32_t value , ATOMICS_WAIT_RESULT_T waitResult , void * userData );
18
+
19
+
15
20
// Creates a new Worker() that is attached to executing this
16
21
// WebAssembly.Instance and WebAssembly.Memory.
17
22
//
@@ -184,7 +189,7 @@ void emscripten_lock_busyspin_waitinf_acquire(emscripten_lock_t *lock __attribut
184
189
// use this API in Worker, you cannot utilise an infinite loop programming
185
190
// model.
186
191
void emscripten_lock_async_acquire (emscripten_lock_t * lock __attribute__((nonnull )),
187
- void ( * asyncWaitFinished )( volatile void * address , uint32_t value , ATOMICS_WAIT_RESULT_T waitResult , void * userData ) __attribute__((nonnull )),
192
+ emscripten_async_wait_volatile_callback_t asyncWaitFinished __attribute__((nonnull )),
188
193
void * userData ,
189
194
double maxWaitMilliseconds );
190
195
@@ -218,7 +223,7 @@ int emscripten_semaphore_try_acquire(emscripten_semaphore_t *sem __attribute__((
218
223
// acquired. If you use this API in Worker, you cannot run an infinite loop.
219
224
void emscripten_semaphore_async_acquire (emscripten_semaphore_t * sem __attribute__((nonnull )),
220
225
int num ,
221
- void ( * asyncWaitFinished )( volatile void * address , uint32_t idx , ATOMICS_WAIT_RESULT_T result , void * userData ) __attribute__((nonnull )),
226
+ emscripten_async_wait_volatile_callback_t asyncWaitFinished __attribute__((nonnull )),
222
227
void * userData ,
223
228
double maxWaitMilliseconds );
224
229
@@ -269,10 +274,10 @@ bool emscripten_condvar_wait(emscripten_condvar_t *condvar __attribute__((nonnul
269
274
270
275
// Asynchronously wait for the given condition variable to signal.
271
276
ATOMICS_WAIT_TOKEN_T emscripten_condvar_wait_async (emscripten_condvar_t * condvar __attribute__((nonnull )),
272
- emscripten_lock_t * lock __attribute__((nonnull )),
273
- void ( * asyncWaitFinished )( int32_t * address , uint32_t value , ATOMICS_WAIT_RESULT_T waitResult , void * userData ) __attribute__((nonnull )),
274
- void * userData ,
275
- double maxWaitMilliseconds );
277
+ emscripten_lock_t * lock __attribute__((nonnull )),
278
+ emscripten_async_wait_callback_t asyncWaitFinished __attribute__((nonnull )),
279
+ void * userData ,
280
+ double maxWaitMilliseconds );
276
281
277
282
// Signals the given number of waiters on the specified condition variable.
278
283
// Pass numWaitersToSignal == EMSCRIPTEN_NOTIFY_ALL_WAITERS to wake all waiters
0 commit comments