Added forgotten(?) wxMutexGuiEnter.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@22724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2003-08-09 17:08:01 +00:00
parent dc1e40c83f
commit a54c4cc2d1

View File

@@ -823,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);