]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/thrimpl.cpp
removed duplicate entries for UTF-16/32 (which are aliases for either LE or BE varian...
[wxWidgets.git] / include / wx / thrimpl.cpp
index d0cf9fd610b2d3bc1c22d04fb7941c274978b409..c1f13ec3d9f1998b97a93bd9ac3c65eb6cb6394b 100644 (file)
@@ -133,7 +133,12 @@ wxCondError wxConditionInternal::Wait()
     wxSemaError err = m_semaphore.Wait();
     m_mutex.Lock();
 
-    return err == wxSEMA_NO_ERROR ? wxCOND_NO_ERROR : wxCOND_MISC_ERROR;
+    if ( err == wxSEMA_NO_ERROR )
+        return wxCOND_NO_ERROR;
+    else if ( err == wxSEMA_TIMEOUT )
+        return wxCOND_TIMEOUT;
+    else
+        return wxCOND_MISC_ERROR;
 }
 
 wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds)
@@ -148,7 +153,7 @@ wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds)
 
     wxSemaError err = m_semaphore.WaitTimeout(milliseconds);
 
-    if ( err == wxSEMA_BUSY )
+    if ( err == wxSEMA_TIMEOUT )
     {
         // another potential race condition exists here it is caused when a
         // 'waiting' thread timesout, and returns from WaitForSingleObject, but
@@ -174,7 +179,9 @@ wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds)
 
     m_mutex.Lock();
 
-    return err == wxSEMA_NO_ERROR ? wxCOND_NO_ERROR : wxCOND_MISC_ERROR;
+    return err == wxSEMA_NO_ERROR ? wxCOND_NO_ERROR
+                                  : err == wxSEMA_TIMEOUT ? wxCOND_TIMEOUT
+                                                          : wxCOND_MISC_ERROR;
 }
 
 wxCondError wxConditionInternal::Signal()