Skip to content

Commit e636ca1

Browse files
committed
Remove unnecessary export of emscripten_futex_wake. NFC
This was being exported solely for the benefit of an assertions that I don't think served any purpose. Its not clear exactly what this assertion was trying to check for but I think it was checking for case where the Module object was not initialized on the thread. However before this try/catch is even executed we have already run several native methods. For example, see `Module['__emscripten_thread_init']` just above. For this reason I think removing the asserting and the extra export is the correct action.
1 parent 7163beb commit e636ca1

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

emcc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,6 @@ def default_setting(name, new_default):
19511951
'__emscripten_thread_init',
19521952
'__emscripten_thread_exit',
19531953
'_emscripten_tls_init',
1954-
'_emscripten_futex_wake',
19551954
'_emscripten_current_thread_process_queued_calls',
19561955
'_pthread_self',
19571956
]

src/library_pthread.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
var LibraryPThread = {
88
$PThread__postset: 'if (!ENVIRONMENT_IS_PTHREAD) PThread.initMainThreadBlock();',
99
$PThread__deps: ['_emscripten_thread_init',
10-
'emscripten_futex_wake', '$killThread',
10+
'$killThread',
1111
'$cancelThread', '$cleanupThread', '$zeroMemory',
1212
'_emscripten_thread_free_data',
1313
'exit',

src/worker.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,6 @@ self.onmessage = function(e) {
237237
#endif
238238
} catch(ex) {
239239
if (ex != 'unwind') {
240-
#if ASSERTIONS
241-
// FIXME(sbc): Figure out if this is still needed or useful. Its not
242-
// clear to me how this check could ever fail. In order to get into
243-
// this try/catch block at all we have already called bunch of
244-
// functions on `Module`.. why is this one special?
245-
if (typeof(Module['_emscripten_futex_wake']) !== 'function') {
246-
err("Thread Initialisation failed.");
247-
throw ex;
248-
}
249-
#endif
250240
// ExitStatus not present in MINIMAL_RUNTIME
251241
#if !MINIMAL_RUNTIME
252242
if (ex instanceof Module['ExitStatus']) {

0 commit comments

Comments
 (0)