]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/threadpsx.cpp
Move menu messages handling from wxFrame to wxTLW in wxMSW.
[wxWidgets.git] / src / unix / threadpsx.cpp
index 1bd59365237fb632701342768d921ae593010f54..952c77c9c76e0250c9e70105ba399f411f8b8bbb 100644 (file)
     #include <thread.h>
 #endif
 
-#ifdef HAVE_CXXABI_H
+#ifdef HAVE_ABI_FORCEDUNWIND
     #include <cxxabi.h>
 #endif
 
+#ifdef HAVE_SETPRIORITY
+    #include <sys/resource.h>   // for setpriority()
+#endif
+
 // we use wxFFile under Linux in GetCPUCount()
 #ifdef __LINUX__
     #include "wx/ffile.h"
-    #include <sys/resource.h>   // for setpriority()
 #endif
 
 #define THR_ID_CAST(id)  (reinterpret_cast<void*>(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);