X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76a6e80383f1485b4d0e11ff2c5de632e46bc36e..977b867e72fe5c836d5af43ac087c943afc463f1:/src/unix/threadpsx.cpp?ds=sidebyside diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index ae471b8d6b..3da088548d 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -113,7 +113,7 @@ WX_DEFINE_ARRAY(wxThread *, wxArrayThread); static wxArrayThread gs_allThreads; // the id of the main thread -static pthread_t gs_tidMain; +static pthread_t gs_tidMain = (pthread_t)-1; // the key for the pointer to the associated wxThread object static pthread_key_t gs_keySelf; @@ -678,7 +678,7 @@ public: private: pthread_t m_threadId; // id of the thread wxThreadState m_state; // see wxThreadState enum - int m_prio; // in wxWindows units: from 0 to 100 + int m_prio; // in wxWidgets units: from 0 to 100 // this flag is set when the thread should terminate bool m_cancelled; @@ -957,7 +957,7 @@ wxThread *wxThread::This() bool wxThread::IsMain() { - return (bool)pthread_equal(pthread_self(), gs_tidMain); + return (bool)pthread_equal(pthread_self(), gs_tidMain) || gs_tidMain == (pthread_t)-1; } void wxThread::Yield() @@ -969,7 +969,7 @@ void wxThread::Yield() void wxThread::Sleep(unsigned long milliseconds) { - wxUsleep(milliseconds); + wxMilliSleep(milliseconds); } int wxThread::GetCPUCount()