@@ -795,27 +795,12 @@ var LibraryPThread = {
795
795
#endif
796
796
} ,
797
797
798
- pthread_kill__deps : [ 'emscripten_main_browser_thread_id' ] ,
799
- pthread_kill : function ( thread , signal ) {
800
- if ( signal < 0 || signal >= 65 /*_NSIG*/ ) return { { { cDefine ( 'EINVAL' ) } } } ;
801
- if ( thread === _emscripten_main_browser_thread_id ( ) ) {
802
- if ( signal == 0 ) return 0 ; // signal == 0 is a no-op.
803
- err ( 'Main thread (id=' + ptrToString ( thread ) + ') cannot be killed with pthread_kill!' ) ;
804
- return { { { cDefine ( 'ESRCH' ) } } } ;
805
- }
806
- if ( ! thread ) {
807
- err ( 'pthread_kill attempted on a null thread pointer!' ) ;
808
- return { { { cDefine ( 'ESRCH' ) } } } ;
809
- }
810
- var self = { { { makeGetValue ( 'thread' , C_STRUCTS . pthread . self , 'i32' ) } } } ;
811
- if ( self !== thread ) {
812
- err ( 'pthread_kill attempted on thread ' + ptrToString ( thread ) + ', which does not point to a valid thread, or does not exist anymore!' ) ;
813
- return { { { cDefine ( 'ESRCH' ) } } } ;
814
- }
798
+ __pthread_kill_js__deps : [ 'emscripten_main_browser_thread_id' ] ,
799
+ __pthread_kill_js : function ( thread , signal ) {
815
800
if ( signal === { { { cDefine ( 'SIGCANCEL' ) } } } ) { // Used by pthread_cancel in musl
816
801
if ( ! ENVIRONMENT_IS_PTHREAD ) cancelThread ( thread ) ;
817
802
else postMessage ( { 'cmd' : 'cancelThread' , 'thread' : thread } ) ;
818
- } else if ( signal != 0 ) {
803
+ } else {
819
804
if ( ! ENVIRONMENT_IS_PTHREAD ) killThread ( thread ) ;
820
805
else postMessage ( { 'cmd' : 'killThread' , 'thread' : thread } ) ;
821
806
}
0 commit comments