]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/threadpsx.cpp
[ 1216436 ] cleanup 'shadow variable' warnings from gcc in headers.
[wxWidgets.git] / src / unix / threadpsx.cpp
index 7306f1e20707e97b59ddca052a1c212f042090ff..e8aad25e50984bf824c220d0aef919c7c5b08037 100644 (file)
@@ -37,6 +37,7 @@
 #include "wx/intl.h"
 #include "wx/dynarray.h"
 #include "wx/timer.h"
+#include "wx/stopwatch.h"
 
 #include <stdio.h>
 #include <unistd.h>
@@ -969,7 +970,7 @@ void wxThread::Yield()
 
 void wxThread::Sleep(unsigned long milliseconds)
 {
-    wxUsleep(milliseconds);
+    wxMilliSleep(milliseconds);
 }
 
 int wxThread::GetCPUCount()
@@ -1483,6 +1484,12 @@ void wxThread::Exit(ExitCode status)
         //       only call one thread function at a time :-(
         DeleteThread(this);
     }
+    else
+    {
+        m_critsect.Enter();
+        m_internal->SetState(STATE_EXITED);
+        m_critsect.Leave();
+    }
 
     // terminate the thread (pthread_exit() never returns)
     pthread_exit(status);