]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/thread.h
removed wxHAS_NATIVE_TAB_TRAVERSAL which is now defined in wx/window.h
[wxWidgets.git] / include / wx / thread.h
index 3ef7e47adec2666aa96d50e4c9877a035fa5dcc1..b95652dcac498f158f0c4c7e7503e492064cc16a 100644 (file)
@@ -38,6 +38,7 @@ enum wxMutexError
     wxMUTEX_DEAD_LOCK,      // mutex is already locked by the calling thread
     wxMUTEX_BUSY,           // mutex is already locked by another thread
     wxMUTEX_UNLOCKED,       // attempt to unlock a mutex which is not locked
+    wxMUTEX_TIMEOUT,        // LockTimeout() has timed out
     wxMUTEX_MISC_ERROR      // any other error
 };
 
@@ -149,6 +150,10 @@ public:
     // The caller must call Unlock() later if Lock() returned wxMUTEX_NO_ERROR.
     wxMutexError Lock();
 
+    // Same as Lock() but return wxMUTEX_TIMEOUT if the mutex can't be locked
+    // during the given number of milliseconds
+    wxMutexError LockTimeout(unsigned long ms);
+
     // Try to lock the mutex: if it is currently locked, return immediately
     // with an error. Otherwise the caller must call Unlock().
     wxMutexError TryLock();
@@ -349,9 +354,10 @@ public:
     wxCondError Broadcast();
 
 
+#if WXWIN_COMPATIBILITY_2_6
     // deprecated version, don't use
-    bool Wait(unsigned long milliseconds)
-        { return WaitTimeout(milliseconds) == wxCOND_NO_ERROR; }
+    wxDEPRECATED( bool Wait(unsigned long milliseconds) );
+#endif // WXWIN_COMPATIBILITY_2_6
 
 private:
     wxConditionInternal *m_internal;
@@ -359,6 +365,11 @@ private:
     DECLARE_NO_COPY_CLASS(wxCondition)
 };
 
+#if WXWIN_COMPATIBILITY_2_6
+    inline bool wxCondition::Wait(unsigned long milliseconds)
+        { return WaitTimeout(milliseconds) == wxCOND_NO_ERROR; }
+#endif // WXWIN_COMPATIBILITY_2_6
+
 // ----------------------------------------------------------------------------
 // wxSemaphore: a counter limiting the number of threads concurrently accessing
 //              a shared resource