@@ -24,16 +24,16 @@ static int futex_wait_busy(volatile void *addr, uint32_t val, double timeout) {
2424
2525 // Register globally which address the main thread is simulating to be
2626 // waiting on. When zero, the main thread is not waiting on anything, and on
27- // nonzero, the contents of the address pointed by __emscripten_main_thread_futex
27+ // nonzero, the contents of the address pointed by _emscripten_main_thread_futex
2828 // tell which address the main thread is simulating its wait on.
2929 // We need to be careful of recursion here: If we wait on a futex, and
3030 // then call _emscripten_yield() below, that will call code that takes the
3131 // proxying mutex - which can once more reach this code in a nested call. To
3232 // avoid interference between the two (there is just a single
33- // __emscripten_main_thread_futex at a time), unmark ourselves before calling
33+ // _emscripten_main_thread_futex at a time), unmark ourselves before calling
3434 // the potentially-recursive call. See below for how we handle the case of our
3535 // futex being notified during the time in between when we are not set as the
36- // value of __emscripten_main_thread_futex .
36+ // value of _emscripten_main_thread_futex .
3737 void * last_addr = a_cas_p (& _emscripten_main_thread_futex , 0 , (void * )addr );
3838 // We must not have already been waiting.
3939 assert (last_addr == 0 );
@@ -68,20 +68,20 @@ static int futex_wait_busy(volatile void *addr, uint32_t val, double timeout) {
6868 //
6969 // * wait on futex A
7070 // * recurse into _emscripten_yield(),
71- // which waits on futex B. that sets the __emscripten_main_thread_futex address to
71+ // which waits on futex B. that sets the _emscripten_main_thread_futex address to
7272 // futex B, and there is no longer any mention of futex A.
73- // * a worker is done with futex A. it checks __emscripten_main_thread_futex but does
73+ // * a worker is done with futex A. it checks _emscripten_main_thread_futex but does
7474 // not see A, so it does nothing special for the main thread.
7575 // * a worker is done with futex B. it flips mainThreadMutex from B
7676 // to 0, ending the wait on futex B.
77- // * we return to the wait on futex A. __emscripten_main_thread_futex is 0, but that
77+ // * we return to the wait on futex A. _emscripten_main_thread_futex is 0, but that
7878 // is because of futex B being done - we can't tell from
79- // __emscripten_main_thread_futex whether A is done or not. therefore, check the
79+ // _emscripten_main_thread_futex whether A is done or not. therefore, check the
8080 // memory value of the futex.
8181 //
8282 // That case motivates the design here. Given that, checking the memory
8383 // address is also necessary for other reasons: we unset and re-set our
84- // address in __emscripten_main_thread_futex around calls to
84+ // address in _emscripten_main_thread_futex around calls to
8585 // _emscripten_yield(), and a worker could
8686 // attempt to wake us up right before/after such times.
8787 //
0 commit comments