Skip to content

Commit 5a8c86d

Browse files
committed
exit pthread properly on node [ci skip]
1 parent 0694d4f commit 5a8c86d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/library_pthread.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,11 @@ console.log(' postedded');
937937
else PThread.threadExit(status);
938938
#if WASM_BACKEND
939939
// pthread_exit is marked noReturn, so we must not return from it.
940+
if (ENVIRONMENT_HAS_NODE) {
941+
// exit the pthread properly on node, as a normal JS exception will halt
942+
// the entire application.
943+
process.exit(status);
944+
}
940945
throw 'pthread_exit';
941946
#endif
942947
},

0 commit comments

Comments
 (0)