From: Stefan Csomor Date: Fri, 10 Sep 2010 13:41:50 +0000 (+0000) Subject: adjusting to new gui mutex for osx, see #12411 X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/827833e2e270012069312431aadaf58096286329 adjusting to new gui mutex for osx, see #12411 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 13ad80722e..7e784e285f 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -974,7 +974,17 @@ void wxThreadInternal::Wait() // if the thread we're waiting for is waiting for the GUI mutex, we will // deadlock so make sure we release it temporarily if ( wxThread::IsMain() ) + { +#ifdef __WXOSX__ + // give the thread we're waiting for chance to do the GUI call + // it might be in, we don't do this conditionally as the to be waited on + // thread might have to acquire the mutex later but before terminating + if ( wxGuiOwnedByMainThread() ) + wxMutexGuiLeave(); +#else wxMutexGuiLeave(); +#endif + } wxLogTrace(TRACE_THREADS, wxT("Starting to wait for thread %p to exit."), @@ -1004,9 +1014,11 @@ void wxThreadInternal::Wait() } } +#ifndef __WXOSX__ // reacquire GUI mutex if ( wxThread::IsMain() ) wxMutexGuiEnter(); +#endif } void wxThreadInternal::Pause()