X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76a6e80383f1485b4d0e11ff2c5de632e46bc36e..c156411a0886a4b49a0c30c36153fb3c1edd4b51:/src/unix/threadpsx.cpp diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index ae471b8d6b..429b2a292c 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; @@ -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()