X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9ec1ed2a7eba603e37f7fc90141f2503a1d31954..7a23b2e6970523ea6d4eb836a58e34387ef99d37:/src/unix/threadpsx.cpp diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 89bc5109f7..ac55f84a1f 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -21,11 +21,12 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "thread.h" #endif -#include "wx/defs.h" +// for compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" #if wxUSE_THREADS @@ -166,6 +167,12 @@ private: friend class wxConditionInternal; }; +#ifdef HAVE_PTHREAD_MUTEXATTR_T +// on some systems pthread_mutexattr_settype() is not in the headers (but it is +// in the library, otherwise we wouldn't compile this code at all) +extern "C" int pthread_mutexattr_settype(pthread_mutexattr_t *, int); +#endif + wxMutexInternal::wxMutexInternal(wxMutexType mutexType) { int err; @@ -532,8 +539,17 @@ wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds) return wxSEMA_TIMEOUT; } - if ( m_cond.WaitTimeout(remainingTime) != wxCOND_NO_ERROR ) - return wxSEMA_MISC_ERROR; + switch ( m_cond.WaitTimeout(remainingTime) ) + { + case wxCOND_TIMEOUT: + return wxSEMA_TIMEOUT; + + default: + return wxSEMA_MISC_ERROR; + + case wxCOND_NO_ERROR: + ; + } } m_count--;