X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e02ea2030c4ee8c2d01c5823e2dc3d1ba7837acf..95316a3f245a4baf3046e97222660bed986153ed:/src/unix/threadpsx.cpp diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 1bd5936523..952c77c9c7 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -54,14 +54,17 @@ #include #endif -#ifdef HAVE_CXXABI_H +#ifdef HAVE_ABI_FORCEDUNWIND #include #endif +#ifdef HAVE_SETPRIORITY + #include // for setpriority() +#endif + // we use wxFFile under Linux in GetCPUCount() #ifdef __LINUX__ #include "wx/ffile.h" - #include // for setpriority() #endif #define THR_ID_CAST(id) (reinterpret_cast(id)) @@ -861,7 +864,7 @@ void *wxThreadInternal::PthreadStart(wxThread *thread) wxT("Thread %p Entry() returned %lu."), THR_ID(pthread), wxPtrToUInt(pthread->m_exitcode)); } -#ifdef HAVE_CXXABI_H +#ifdef HAVE_ABI_FORCEDUNWIND // When using common C++ ABI under Linux we must always rethrow this // special exception used to unwind the stack when the thread was // cancelled, otherwise the thread library would simply terminate the @@ -872,7 +875,7 @@ void *wxThreadInternal::PthreadStart(wxThread *thread) pthread->SetState(STATE_EXITED); throw; } -#endif // HAVE_CXXABI_H +#endif // HAVE_ABI_FORCEDUNWIND wxCATCH_ALL( wxTheApp->OnUnhandledException(); ) { @@ -954,7 +957,7 @@ wxThreadInternal::wxThreadInternal() { m_state = STATE_NEW; m_cancelled = false; - m_prio = WXTHREAD_DEFAULT_PRIORITY; + m_prio = wxPRIORITY_DEFAULT; m_threadId = 0; m_exitcode = 0; @@ -1231,7 +1234,7 @@ wxThreadError wxThread::Create(unsigned int WXUNUSED_STACKSIZE(stackSize)) } else if ( max_prio == min_prio ) { - if ( prio != WXTHREAD_DEFAULT_PRIORITY ) + if ( prio != wxPRIORITY_DEFAULT ) { // notify the programmer that this doesn't work here wxLogWarning(_("Thread priority setting is ignored.")); @@ -1320,8 +1323,7 @@ wxThreadError wxThread::Run() void wxThread::SetPriority(unsigned int prio) { - wxCHECK_RET( ((int)WXTHREAD_MIN_PRIORITY <= (int)prio) && - ((int)prio <= (int)WXTHREAD_MAX_PRIORITY), + wxCHECK_RET( wxPRIORITY_MIN <= prio && prio <= wxPRIORITY_MAX, wxT("invalid thread priority") ); wxCriticalSectionLocker lock(m_critsect); @@ -1347,8 +1349,7 @@ void wxThread::SetPriority(unsigned int prio) // // FIXME this is not true for 2.6!! - // map wx priorites WXTHREAD_MIN_PRIORITY..WXTHREAD_MAX_PRIORITY - // to Unix priorities 20..-20 + // map wx priorites 0..100 to Unix priorities 20..-20 if ( setpriority(PRIO_PROCESS, 0, -(2*(int)prio)/5 + 20) == -1 ) { wxLogError(_("Failed to set thread priority %d."), prio);