[haiku-commits] r35142 - in haiku/trunk/src/system/libroot: os posix/pthread posix/stdlib

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 18 Jan 2010 18:58:38 +0100 (CET)

Author: korli
Date: 2010-01-18 18:58:38 +0100 (Mon, 18 Jan 2010)
New Revision: 35142
Changeset: http://dev.haiku-os.org/changeset/35142/haiku

Modified:
   haiku/trunk/src/system/libroot/os/thread.c
   haiku/trunk/src/system/libroot/posix/pthread/pthread.c
   haiku/trunk/src/system/libroot/posix/stdlib/exit.c
Log:
* Rename _thread_do_exit_notification() to _thread_do_exit_work() as suggested 
by Ingo.
Also added an empty stub for _thread_do_exit_notification() when compiling for 
GCC2.
* Removed the check testing if the thread is already dead.


Modified: haiku/trunk/src/system/libroot/os/thread.c
===================================================================
--- haiku/trunk/src/system/libroot/os/thread.c  2010-01-18 08:52:42 UTC (rev 
35141)
+++ haiku/trunk/src/system/libroot/os/thread.c  2010-01-18 17:58:38 UTC (rev 
35142)
@@ -27,7 +27,7 @@
 } callback_node;
 
 
-void _thread_do_exit_notification(void);
+void _thread_do_exit_work(void);
 
 
 static status_t
@@ -40,15 +40,24 @@
 
        returnCode = entry(thread->entry_argument);
 
-       _thread_do_exit_notification();
+       _thread_do_exit_work();
 
        return returnCode;
 }
 
 
+#if __GNUC__ < 3
 void
 _thread_do_exit_notification(void)
 {
+       // empty stub for R5 compability
+}
+#endif
+
+
+void
+_thread_do_exit_work(void)
+{
        callback_node *node = tls_get(TLS_ON_EXIT_THREAD_SLOT);
        callback_node *next;
 

Modified: haiku/trunk/src/system/libroot/posix/pthread/pthread.c
===================================================================
--- haiku/trunk/src/system/libroot/posix/pthread/pthread.c      2010-01-18 
08:52:42 UTC (rev 35141)
+++ haiku/trunk/src/system/libroot/posix/pthread/pthread.c      2010-01-18 
17:58:38 UTC (rev 35142)
@@ -54,10 +54,6 @@
 {
        pthread_thread* thread = pthread_self();
        
-       // check if the thread is already dead
-       if ((atomic_get(&thread->flags) & THREAD_DEAD) != 0)
-               return;
-
        // call cleanup handlers
        while (true) {
                struct __pthread_cleanup_handler* handler

Modified: haiku/trunk/src/system/libroot/posix/stdlib/exit.c
===================================================================
--- haiku/trunk/src/system/libroot/posix/stdlib/exit.c  2010-01-18 08:52:42 UTC 
(rev 35141)
+++ haiku/trunk/src/system/libroot/posix/stdlib/exit.c  2010-01-18 17:58:38 UTC 
(rev 35142)
@@ -22,7 +22,7 @@
 
 
 extern void _IO_cleanup(void);
-extern void _thread_do_exit_notification(void);
+extern void _thread_do_exit_work(void);
 
 struct exit_stack_info {
        void                            (*exit_stack[ATEXIT_MAX])(void);
@@ -127,7 +127,7 @@
 exit(int status)
 {
        // BeOS on exit notification for the main thread
-       _thread_do_exit_notification();
+       _thread_do_exit_work();
 
        // unwind the exit stack, calling the registered functions
        _exit_stack_lock();


Other related posts:

  • » [haiku-commits] r35142 - in haiku/trunk/src/system/libroot: os posix/pthread posix/stdlib - korli