#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))
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
pthread->SetState(STATE_EXITED);
throw;
}
-#endif // HAVE_CXXABI_H
+#endif // HAVE_ABI_FORCEDUNWIND
wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
{
{
m_state = STATE_NEW;
m_cancelled = false;
- m_prio = WXTHREAD_DEFAULT_PRIORITY;
+ m_prio = wxPRIORITY_DEFAULT;
m_threadId = 0;
m_exitcode = 0;
}
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."));
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);
//
// 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);