diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 06b5d4c7966..faafd20cffc 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -79,6 +79,7 @@ extern size_t server_init_thread( void *entry_point ); extern void DECLSPEC_NORETURN server_protocol_error( const char *err, ... ); extern void DECLSPEC_NORETURN server_protocol_perror( const char *err ); extern void DECLSPEC_NORETURN abort_thread( int status ); +extern void DECLSPEC_NORETURN terminate_thread( int status ); extern void DECLSPEC_NORETURN exit_thread( int status ); extern sigset_t server_block_set; extern void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset ); diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 3d7c8e1a26d..f70448a7754 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -2321,6 +2321,14 @@ void WINAPI RtlExitUserThread( ULONG status ) exit_thread( status ); } +/*********************************************************************** + * abort_thread + */ +void abort_thread( int status ) +{ + terminate_thread( status ); +} + /********************************************************************** * DbgBreakPoint (NTDLL.@) */ diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index 92288ad558a..ccd64f99105 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -1111,6 +1111,14 @@ void WINAPI RtlExitUserThread( ULONG status ) exit_thread( status ); } +/*********************************************************************** + * abort_thread + */ +void abort_thread( int status ) +{ + terminate_thread( status ); +} + /********************************************************************** * DbgBreakPoint (NTDLL.@) */ diff --git a/dlls/ntdll/signal_sparc.c b/dlls/ntdll/signal_sparc.c index 55b2a791913..a38d34e8a6b 100644 --- a/dlls/ntdll/signal_sparc.c +++ b/dlls/ntdll/signal_sparc.c @@ -853,6 +853,14 @@ void WINAPI RtlExitUserThread( ULONG status ) exit_thread( status ); } +/*********************************************************************** + * abort_thread + */ +void abort_thread( int status ) +{ + terminate_thread( status ); +} + /********************************************************************** * DbgBreakPoint (NTDLL.@) */ diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 5cb2c9e3008..9b138f01b8e 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -2578,6 +2578,13 @@ void WINAPI RtlExitUserThread( ULONG status ) exit_thread( status ); } +/*********************************************************************** + * abort_thread + */ +void abort_thread( int status ) +{ + terminate_thread( status ); +} /********************************************************************** * __wine_enter_vm86 (NTDLL.@) diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 438d798948a..70ab2bf416e 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -364,9 +364,9 @@ HANDLE thread_init(void) /*********************************************************************** - * abort_thread + * terminate_thread */ -void abort_thread( int status ) +void terminate_thread( int status ) { pthread_sigmask( SIG_BLOCK, &server_block_set, NULL ); if (interlocked_xchg_add( &nb_threads, -1 ) <= 1) _exit( status ); @@ -698,7 +698,7 @@ NTSTATUS WINAPI NtAlertThread( HANDLE handle ) NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code ) { NTSTATUS ret; - BOOL self, last; + BOOL self; SERVER_START_REQ( terminate_thread ) { @@ -706,15 +706,10 @@ NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code ) req->exit_code = exit_code; ret = wine_server_call( req ); self = !ret && reply->self; - last = reply->last; } SERVER_END_REQ; - if (self) - { - if (last) _exit( exit_code ); - else abort_thread( exit_code ); - } + if (self) abort_thread( exit_code ); return ret; }