X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0f00be4b33cdf013af6b64bfbd0e6841e7f0d574..2209baaee3a8578450e204593b79ed155f340f68:/src/msw/thread.cpp diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 24aa2a43fd..23960ebf94 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -10,10 +10,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "thread.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -705,14 +701,17 @@ wxThreadInternal::WaitForTerminate(wxCriticalSection& cs, } } +#if !defined(QS_ALLPOSTMESSAGE) +#define QS_ALLPOSTMESSAGE 0 +#endif + result = ::MsgWaitForMultipleObjects ( 1, // number of objects to wait for &m_hThread, // the objects false, // don't wait for all objects INFINITE, // no timeout - QS_ALLINPUT | // return as soon as there are any events - QS_ALLPOSTMESSAGE + QS_ALLINPUT|QS_ALLPOSTMESSAGE // return as soon as there are any events ); switch ( result ) @@ -738,12 +737,6 @@ wxThreadInternal::WaitForTerminate(wxCriticalSection& cs, // the system might dead lock then if ( wxThread::IsMain() ) { - // it looks that sometimes WAIT_OBJECT_0 + 1 is - // returned but there are no messages in the thread - // queue -- prevent DoMessageFromThreadWait() from - // blocking inside ::GetMessage() forever in this case - ::PostMessage(NULL, WM_NULL, 0, 0); - wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; @@ -885,10 +878,9 @@ unsigned long wxThread::GetCurrentId() return (unsigned long)::GetCurrentThreadId(); } -bool wxThread::SetConcurrency(size_t level) +bool wxThread::SetConcurrency(size_t WXUNUSED_IN_WINCE(level)) { #ifdef __WXWINCE__ - wxUnusedVar(level); return false; #else wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") ); @@ -927,7 +919,7 @@ bool wxThread::SetConcurrency(size_t level) dwProcMask |= bit; // another process added - if ( !--level ) + if ( --level == 0 ) { // and that's enough break;