Marcelo Dalmas - 2001-11-13

1. Threads isRunning() look for (_tid != 0), but execHandler() dont do _tid = 0 before pthread_exit().

2. If a thread is detached (Detach()) Final() dont execute.
execHandler()  verify:
if(!pthread_detach(th->_tid) && th->_parent)

but is thread is detached then pthread_detach() return EINVAL.

diff -ru CommonC++-1.9.0/src/thread.cpp CommonC++-1.9.0-mad/src/thread.cpp
--- CommonC++-1.9.0/src/thread.cpp    Mon Oct 29 15:28:34 2001
+++ CommonC++-1.9.0-mad/src/thread.cpp    Tue Nov 13 12:03:35 2001
@@ -451,9 +451,10 @@
#endif

     th->setCancel(THREAD_CANCEL_DISABLED);
-    if(!pthread_detach(th->_tid) && th->_parent)
+    if(th->_parent)
         th->_parent->Notify(th);
     th->Final();
+    th->_tid = 0;
     pthread_exit(NULL);
   }
}