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

Alexandre Julliard julliard at winehq.org
Fri Aug 28 10:18:41 CDT 2009


Module: wine
Branch: master
Commit: 8101a2fa1e9124e4e2f5f2677719733dd8f1fd12
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8101a2fa1e9124e4e2f5f2677719733dd8f1fd12

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Aug 28 11:52:21 2009 +0200

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

---

 dlls/ntdll/ntdll_misc.h     |    1 +
 dlls/ntdll/signal_i386.c    |    8 ++++++++
 dlls/ntdll/signal_powerpc.c |    8 ++++++++
 dlls/ntdll/signal_sparc.c   |    8 ++++++++
 dlls/ntdll/signal_x86_64.c  |    7 +++++++
 dlls/ntdll/thread.c         |   13 ++++---------
 6 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 06b5d4c..faafd20 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 3d7c8e1..f70448a 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 92288ad..ccd64f9 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 55b2a79..a38d34e 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 5cb2c9e..9b138f0 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 438d798..70ab2bf 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;
 }
 




More information about the wine-cvs mailing list