ntdll: Move the abort_thread() function to the CPU-specific files to allow redefining it.

This commit is contained in:
Alexandre Julliard 2009-08-28 11:52:21 +02:00
parent 28e345882c
commit 8101a2fa1e
6 changed files with 36 additions and 9 deletions

View File

@ -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_error( const char *err, ... );
extern void DECLSPEC_NORETURN server_protocol_perror( 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 abort_thread( int status );
extern void DECLSPEC_NORETURN terminate_thread( int status );
extern void DECLSPEC_NORETURN exit_thread( int status ); extern void DECLSPEC_NORETURN exit_thread( int status );
extern sigset_t server_block_set; extern sigset_t server_block_set;
extern void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset ); extern void server_enter_uninterrupted_section( RTL_CRITICAL_SECTION *cs, sigset_t *sigset );

View File

@ -2321,6 +2321,14 @@ void WINAPI RtlExitUserThread( ULONG status )
exit_thread( status ); exit_thread( status );
} }
/***********************************************************************
* abort_thread
*/
void abort_thread( int status )
{
terminate_thread( status );
}
/********************************************************************** /**********************************************************************
* DbgBreakPoint (NTDLL.@) * DbgBreakPoint (NTDLL.@)
*/ */

View File

@ -1111,6 +1111,14 @@ void WINAPI RtlExitUserThread( ULONG status )
exit_thread( status ); exit_thread( status );
} }
/***********************************************************************
* abort_thread
*/
void abort_thread( int status )
{
terminate_thread( status );
}
/********************************************************************** /**********************************************************************
* DbgBreakPoint (NTDLL.@) * DbgBreakPoint (NTDLL.@)
*/ */

View File

@ -853,6 +853,14 @@ void WINAPI RtlExitUserThread( ULONG status )
exit_thread( status ); exit_thread( status );
} }
/***********************************************************************
* abort_thread
*/
void abort_thread( int status )
{
terminate_thread( status );
}
/********************************************************************** /**********************************************************************
* DbgBreakPoint (NTDLL.@) * DbgBreakPoint (NTDLL.@)
*/ */

View File

@ -2578,6 +2578,13 @@ void WINAPI RtlExitUserThread( ULONG status )
exit_thread( status ); exit_thread( status );
} }
/***********************************************************************
* abort_thread
*/
void abort_thread( int status )
{
terminate_thread( status );
}
/********************************************************************** /**********************************************************************
* __wine_enter_vm86 (NTDLL.@) * __wine_enter_vm86 (NTDLL.@)

View File

@ -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 ); pthread_sigmask( SIG_BLOCK, &server_block_set, NULL );
if (interlocked_xchg_add( &nb_threads, -1 ) <= 1) _exit( status ); 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 WINAPI NtTerminateThread( HANDLE handle, LONG exit_code )
{ {
NTSTATUS ret; NTSTATUS ret;
BOOL self, last; BOOL self;
SERVER_START_REQ( terminate_thread ) SERVER_START_REQ( terminate_thread )
{ {
@ -706,15 +706,10 @@ NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code )
req->exit_code = exit_code; req->exit_code = exit_code;
ret = wine_server_call( req ); ret = wine_server_call( req );
self = !ret && reply->self; self = !ret && reply->self;
last = reply->last;
} }
SERVER_END_REQ; SERVER_END_REQ;
if (self) if (self) abort_thread( exit_code );
{
if (last) _exit( exit_code );
else abort_thread( exit_code );
}
return ret; return ret;
} }