]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/thread.cpp
Reversed the meaning of black and white in wxRegion::ConvertToBitmap
[wxWidgets.git] / src / msw / thread.cpp
index cf2353b6157b7d5f7386936d10f2346c221490a6..92f34c9ca8b8914972b31ffd03b9be0b7aacc6f8 100644 (file)
@@ -267,7 +267,16 @@ public:
     bool IsOk() const { return m_semaphore != NULL; }
 
     wxSemaError Wait() { return WaitTimeout(INFINITE); }
-    wxSemaError TryWait() { return WaitTimeout(0); }
+
+    wxSemaError TryWait()
+    {
+        wxSemaError rc = WaitTimeout(0);
+        if ( rc == wxSEMA_TIMEOUT )
+            rc = wxSEMA_BUSY;
+
+        return rc;
+    }
+
     wxSemaError WaitTimeout(unsigned long milliseconds);
 
     wxSemaError Post();
@@ -321,7 +330,7 @@ wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds)
            return wxSEMA_NO_ERROR;
 
         case WAIT_TIMEOUT:
-           return wxSEMA_BUSY;
+           return wxSEMA_TIMEOUT;
 
         default:
             wxLogLastError(_T("WaitForSingleObject(semaphore)"));
@@ -665,6 +674,8 @@ bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize)
         SetPriority(m_priority);
     }
 
+    m_state = STATE_NEW;
+
     return TRUE;
 }