X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e60defcb943dcbbc15ad50059954778c161bda1f..1ee968ea97b66a9795f76c4030874be0faa632d5:/src/unix/threadpsx.cpp diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 1e555050f1..ed33ff33c0 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -1127,18 +1127,23 @@ wxThreadIdType wxThread::GetCurrentId() bool wxThread::SetConcurrency(size_t level) { -#ifdef HAVE_THR_SETCONCURRENCY +#ifdef HAVE_PTHREAD_SET_CONCURRENCY + int rc = pthread_setconcurrency( level ); +#elif defined(HAVE_THR_SETCONCURRENCY) int rc = thr_setconcurrency(level); +#else // !HAVE_THR_SETCONCURRENCY + // ok only for the default value + int rc = level == 0 ? 0 : -1; +#endif // HAVE_THR_SETCONCURRENCY/!HAVE_THR_SETCONCURRENCY + if ( rc != 0 ) { - wxLogSysError(rc, wxT("thr_setconcurrency() failed")); + wxLogSysError(rc, _("Failed to set thread concurrency level to %lu"), + static_cast(level)); + return false; } - return rc == 0; -#else // !HAVE_THR_SETCONCURRENCY - // ok only for the default value - return level == 0; -#endif // HAVE_THR_SETCONCURRENCY/!HAVE_THR_SETCONCURRENCY + return true; } // ----------------------------------------------------------------------------- @@ -1832,7 +1837,7 @@ static void DeleteThread(wxThread *This) } } -#ifndef __WXOSX__ +#ifndef __DARWIN__ void wxMutexGuiEnterImpl() {