X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9ec1ed2a7eba603e37f7fc90141f2503a1d31954..c0440c7833f4a7966fac477b1541b085142adaa6:/src/unix/threadpsx.cpp diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 89bc5109f7..597f87eb8d 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -166,6 +166,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 +538,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--;