diff --git a/src/lib/libpthread.js b/src/lib/libpthread.js index 44d75892c6e13..7ab90dff1a62a 100644 --- a/src/lib/libpthread.js +++ b/src/lib/libpthread.js @@ -344,12 +344,6 @@ var LibraryPThread = { #endif #if expectToReceiveOnModule('onAbort') 'onAbort', -#endif -#if expectToReceiveOnModule('print') - 'print', -#endif -#if expectToReceiveOnModule('printErr') - 'printErr', #endif ]; for (var handler of knownHandlers) { diff --git a/src/runtime_pthread.js b/src/runtime_pthread.js index a77b2d9bbcc38..b637defa380cf 100644 --- a/src/runtime_pthread.js +++ b/src/runtime_pthread.js @@ -82,7 +82,7 @@ if (ENVIRONMENT_IS_PTHREAD) { // Use `const` here to ensure that the variable is scoped only to // that iteration, allowing safe reference from a closure. for (const handler of msgData.handlers) { - // The the main module has a handler for a certain even, but no + // The main module has a handler for a certain event, but no // handler exists on the pthread worker, then proxy that handler // back to the main thread. if (!Module[handler] || Module[handler].proxy) { @@ -95,9 +95,6 @@ if (ENVIRONMENT_IS_PTHREAD) { #endif postMessage({ cmd: 'callHandler', handler, args: args }); } - // Rebind the out / err handlers if needed - if (handler == 'print') out = Module[handler]; - if (handler == 'printErr') err = Module[handler]; } #if RUNTIME_DEBUG else dbg(`worker: using thread-local handler: ${handler}`); diff --git a/test/code_size/test_codesize_minimal_pthreads.json b/test/code_size/test_codesize_minimal_pthreads.json index dae747cce1239..90274311f5b69 100644 --- a/test/code_size/test_codesize_minimal_pthreads.json +++ b/test/code_size/test_codesize_minimal_pthreads.json @@ -1,10 +1,10 @@ { - "a.out.js": 7659, - "a.out.js.gz": 3776, + "a.out.js": 7613, + "a.out.js.gz": 3753, "a.out.nodebug.wasm": 19592, "a.out.nodebug.wasm.gz": 9060, - "total": 27251, - "total_gz": 12836, + "total": 27205, + "total_gz": 12813, "sent": [ "a (memory)", "b (emscripten_get_now)", diff --git a/test/code_size/test_codesize_minimal_pthreads_memgrowth.json b/test/code_size/test_codesize_minimal_pthreads_memgrowth.json index 521a48e365036..8c1217e1574b1 100644 --- a/test/code_size/test_codesize_minimal_pthreads_memgrowth.json +++ b/test/code_size/test_codesize_minimal_pthreads_memgrowth.json @@ -1,10 +1,10 @@ { - "a.out.js": 8086, - "a.out.js.gz": 3977, + "a.out.js": 8040, + "a.out.js.gz": 3953, "a.out.nodebug.wasm": 19593, "a.out.nodebug.wasm.gz": 9061, - "total": 27679, - "total_gz": 13038, + "total": 27633, + "total_gz": 13014, "sent": [ "a (memory)", "b (emscripten_get_now)", diff --git a/test/test_other.py b/test/test_other.py index ac5bfb01aafa8..1a23b9f68ae9b 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -7235,42 +7235,6 @@ def test_modularize_instantiation_error(self): self.assertContained('failed to asynchronously prepare wasm', output) self.assertContained('got error: RuntimeError: Aborted', output) - @crossplatform - @node_pthreads - @flaky('https://github.com/emscripten-core/emscripten/issues/19683') - # The flakiness of this test is very high on macOS so just disable it - # completely. - @no_mac('https://github.com/emscripten-core/emscripten/issues/19683') - def test_pthread_print_override_modularize(self): - self.set_setting('EXPORT_NAME', 'Test') - self.set_setting('PROXY_TO_PTHREAD') - self.set_setting('EXIT_RUNTIME') - self.set_setting('MODULARIZE') - create_file('main.c', ''' - #include - - int main() { - emscripten_out("hello, world!"); - return 0; - } - ''') - create_file('main.js', ''' - const Test = require('./test.js'); - - async function main() { - await Test({ - // world -> earth - print: (text) => console.log(text.replace('world', 'earth')) - }); - } - main(); - ''') - - self.emcc('main.c', output_filename='test.js') - output = self.run_js('main.js') - self.assertNotContained('hello, world!', output) - self.assertContained('hello, earth!', output) - def test_define_modularize(self): self.run_process([EMCC, test_file('hello_world.c'), '-sMODULARIZE', '-sASSERTIONS=0']) src = 'var module = 0; ' + read_file('a.out.js')