@@ -178,7 +178,7 @@ var LibraryPThread = {
178
178
if ( ENVIRONMENT_IS_PTHREAD && _pthread_self ( ) ) ___pthread_tsd_run_dtors ( ) ;
179
179
} ,
180
180
181
- onThreadExit : function ( tb , exitCode ) {
181
+ runExitHandlersAndDeinitThread : function ( tb , exitCode ) {
182
182
// Disable all cancellation so that executing the cleanup handlers won't trigger another JS
183
183
// canceled exception to be thrown.
184
184
Atomics . store ( HEAPU32 , ( tb + { { { C_STRUCTS . pthread . canceldisable } } } ) >> 2 , 1 /*PTHREAD_CANCEL_DISABLE*/ ) ;
@@ -209,7 +209,7 @@ var LibraryPThread = {
209
209
Atomics . store ( HEAPU32 , ( tb + { { { C_STRUCTS . pthread . profilerBlock } } } ) >> 2 , 0 ) ;
210
210
_free ( profilerBlock ) ;
211
211
#endif
212
- PThread . onThreadExit ( tb , exitCode ) ;
212
+ PThread . runExitHandlersAndDeinitThread ( tb , exitCode ) ;
213
213
214
214
if ( ENVIRONMENT_IS_PTHREAD ) {
215
215
// Note: in theory we would like to return any offscreen canvases back to the main thread,
@@ -221,7 +221,7 @@ var LibraryPThread = {
221
221
222
222
threadCancel : function ( ) {
223
223
var tb = _pthread_self ( ) ;
224
- PThread . onThreadExit ( tb , - 1 /*PTHREAD_CANCELED*/ ) ;
224
+ PThread . runExitHandlersAndDeinitThread ( tb , - 1 /*PTHREAD_CANCELED*/ ) ;
225
225
postMessage ( { 'cmd' : 'cancelDone' } ) ;
226
226
} ,
227
227
0 commit comments