]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/threadpsx.cpp
OpenVMS update
[wxWidgets.git] / src / unix / threadpsx.cpp
index a5fa470848e285e249c81fb1d664ed59acddd3c4..850543d345fe7f52f53103ca647958ec7e21d502 100644 (file)
@@ -255,6 +255,7 @@ wxMutexError wxMutexInternal::Lock()
 
 wxMutexError wxMutexInternal::Lock(unsigned long ms)
 {
+#ifdef HAVE_PTHREAD_MUTEX_TIMEDLOCK
     static const long MSEC_IN_SEC   = 1000;
     static const long NSEC_IN_MSEC  = 1000000;
     static const long NSEC_IN_USEC  = 1000;
@@ -295,6 +296,11 @@ wxMutexError wxMutexInternal::Lock(unsigned long ms)
     }
 
     return HandleLockResult(pthread_mutex_timedlock(&m_mutex, &ts));
+#else // !HAVE_PTHREAD_MUTEX_TIMEDLOCK
+    wxUnusedVar(ms);
+
+    return wxMUTEX_MISC_ERROR;
+#endif // HAVE_PTHREAD_MUTEX_TIMEDLOCK/!HAVE_PTHREAD_MUTEX_TIMEDLOCK
 }
 
 wxMutexError wxMutexInternal::HandleLockResult(int err)
@@ -1305,7 +1311,7 @@ void wxThread::SetPriority(unsigned int prio)
 
             // map wx priorites WXTHREAD_MIN_PRIORITY..WXTHREAD_MAX_PRIORITY
             // to Unix priorities 20..-20
-            if ( setpriority(PRIO_PROCESS, 0, -(2*prio)/5 + 20) == -1 )
+            if ( setpriority(PRIO_PROCESS, 0, -(2*(int)prio)/5 + 20) == -1 )
             {
                 wxLogError(_("Failed to set thread priority %d."), prio);
             }