Fix wxOSX' wxThread::Wait() with configure-based wxBase build
Check for platform using __DARWIN__ instead of using __WXOSX__ which shouldn't be defined in builds with wxUSE_GUI set to 0. Closes https://github.com/wxWidgets/wxWidgets/pull/93.
This commit is contained in:
@@ -140,7 +140,7 @@ static wxMutex *gs_mutexDeleteThread = NULL;
|
|||||||
// gs_nThreadsBeingDeleted will have been deleted
|
// gs_nThreadsBeingDeleted will have been deleted
|
||||||
static wxCondition *gs_condAllDeleted = NULL;
|
static wxCondition *gs_condAllDeleted = NULL;
|
||||||
|
|
||||||
#ifndef __WXOSX__
|
#ifndef __DARWIN__
|
||||||
// this mutex must be acquired before any call to a GUI function
|
// this mutex must be acquired before any call to a GUI function
|
||||||
// (it's not inside #if wxUSE_GUI because this file is compiled as part
|
// (it's not inside #if wxUSE_GUI because this file is compiled as part
|
||||||
// of wxBase)
|
// of wxBase)
|
||||||
@@ -1132,7 +1132,7 @@ void wxThreadInternal::Wait()
|
|||||||
// deadlock so make sure we release it temporarily
|
// deadlock so make sure we release it temporarily
|
||||||
if ( wxThread::IsMain() )
|
if ( wxThread::IsMain() )
|
||||||
{
|
{
|
||||||
#ifdef __WXOSX__
|
#ifdef __DARWIN__
|
||||||
// give the thread we're waiting for chance to do the GUI call
|
// 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
|
// 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
|
// thread might have to acquire the mutex later but before terminating
|
||||||
@@ -1171,7 +1171,7 @@ void wxThreadInternal::Wait()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __WXOSX__
|
#ifndef __DARWIN__
|
||||||
// reacquire GUI mutex
|
// reacquire GUI mutex
|
||||||
if ( wxThread::IsMain() )
|
if ( wxThread::IsMain() )
|
||||||
wxMutexGuiEnter();
|
wxMutexGuiEnter();
|
||||||
@@ -1769,7 +1769,7 @@ bool wxThread::IsPaused() const
|
|||||||
// wxThreadModule
|
// wxThreadModule
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __WXOSX__
|
#ifdef __DARWIN__
|
||||||
void wxOSXThreadModuleOnInit();
|
void wxOSXThreadModuleOnInit();
|
||||||
void wxOSXThreadModuleOnExit();
|
void wxOSXThreadModuleOnExit();
|
||||||
#endif
|
#endif
|
||||||
@@ -1800,7 +1800,7 @@ bool wxThreadModule::OnInit()
|
|||||||
|
|
||||||
gs_mutexAllThreads = new wxMutex();
|
gs_mutexAllThreads = new wxMutex();
|
||||||
|
|
||||||
#ifdef __WXOSX__
|
#ifdef __DARWIN__
|
||||||
wxOSXThreadModuleOnInit();
|
wxOSXThreadModuleOnInit();
|
||||||
#else
|
#else
|
||||||
gs_mutexGui = new wxMutex();
|
gs_mutexGui = new wxMutex();
|
||||||
@@ -1858,7 +1858,7 @@ void wxThreadModule::OnExit()
|
|||||||
|
|
||||||
delete gs_mutexAllThreads;
|
delete gs_mutexAllThreads;
|
||||||
|
|
||||||
#ifdef __WXOSX__
|
#ifdef __DARWIN__
|
||||||
wxOSXThreadModuleOnExit();
|
wxOSXThreadModuleOnExit();
|
||||||
#else
|
#else
|
||||||
// destroy GUI mutex
|
// destroy GUI mutex
|
||||||
|
Reference in New Issue
Block a user