We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d41318 commit cfe6160Copy full SHA for cfe6160
src/library_pthread.js
@@ -190,9 +190,10 @@ var LibraryPThread = {
190
191
#if ENVIRONMENT_MAY_BE_NODE
192
if (ENVIRONMENT_IS_NODE) {
193
- // Mark the worker as weakly referenced so that its existence does
194
- // not prevent Node.js from exiting. This has no effect if the
195
- // worker is already weakly referenced.
+ // Once a pthread has finished and the worker becomes idle, mark it
+ // as weakly referenced so that its existence does not prevent Node.js
+ // from exiting. This has no effect if the worker is already weakly
196
+ // referenced.
197
worker.unref();
198
}
199
#endif
0 commit comments