X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..a1900c9e1d07ac71f373f94656bf26a45f032c39:/src/os2/thread.cpp diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index ad67a34b11..04ee638e57 100644 --- a/src/os2/thread.cpp +++ b/src/os2/thread.cpp @@ -484,6 +484,9 @@ bool wxThreadInternal::Create( { SetPriority(m_nPriority); } + + m_eState = STATE_NEW; + return(TRUE); } @@ -820,6 +823,28 @@ void WXDLLEXPORT wxWakeUpMainThread() { } +void WXDLLEXPORT wxMutexGuiEnter() +{ + // this would dead lock everything... + wxASSERT_MSG( !wxThread::IsMain(), + wxT("main thread doesn't want to block in wxMutexGuiEnter()!") ); + + // the order in which we enter the critical sections here is crucial!! + + // set the flag telling to the main thread that we want to do some GUI + { + wxCriticalSectionLocker enter(*gs_pCritsectWaitingForGui); + + gs_nWaitingForGui++; + } + + wxWakeUpMainThread(); + + // now we may block here because the main thread will soon let us in + // (during the next iteration of OnIdle()) + gs_pCritsectGui->Enter(); +} + void WXDLLEXPORT wxMutexGuiLeave() { wxCriticalSectionLocker enter(*gs_pCritsectWaitingForGui);