]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/thread.cpp
fixing border drawing for toplevel controls on dialogs, fixes #10877
[wxWidgets.git] / src / msw / thread.cpp
index cc4d13a2e6f37cfb926c3196a5dcd31de2313910..29dcb255d9bbddd03363a221e1951ce61f24bc53 100644 (file)
@@ -189,11 +189,11 @@ private:
     wxMutexError LockTimeout(DWORD milliseconds);
 
     HANDLE m_mutex;
-    
+
     unsigned long m_owningThread;
     wxMutexType m_type;
 
-    DECLARE_NO_COPY_CLASS(wxMutexInternal)
+    wxDECLARE_NO_COPY_CLASS(wxMutexInternal);
 };
 
 // all mutexes are recursive under Win32 so we don't use mutexType
@@ -214,7 +214,7 @@ wxMutexInternal::wxMutexInternal(wxMutexType mutexType)
     {
         wxLogLastError(_T("CreateMutex()"));
     }
-    
+
 }
 
 wxMutexInternal::~wxMutexInternal()
@@ -249,18 +249,14 @@ wxMutexError wxMutexInternal::LockTimeout(DWORD milliseconds)
     }
 
     DWORD rc = ::WaitForSingleObject(m_mutex, milliseconds);
-    if ( rc == WAIT_ABANDONED )
-    {
-        // the previous caller died without releasing the mutex, but now we can
-        // really lock it
-        wxLogDebug(_T("WaitForSingleObject() returned WAIT_ABANDONED"));
-
-        // use 0 timeout, normally we should always get it
-        rc = ::WaitForSingleObject(m_mutex, 0);
-    }
-
     switch ( rc )
     {
+        case WAIT_ABANDONED:
+            // the previous caller died without releasing the mutex, so even
+            // though we did get it, log a message about this
+            wxLogDebug(_T("WaitForSingleObject() returned WAIT_ABANDONED"));
+            // fall through
+
         case WAIT_OBJECT_0:
             // ok
             break;
@@ -268,7 +264,6 @@ wxMutexError wxMutexInternal::LockTimeout(DWORD milliseconds)
         case WAIT_TIMEOUT:
             return wxMUTEX_TIMEOUT;
 
-        case WAIT_ABANDONED:        // checked for above
         default:
             wxFAIL_MSG(wxT("impossible return value in wxMutex::Lock"));
             // fall through
@@ -279,11 +274,11 @@ wxMutexError wxMutexInternal::LockTimeout(DWORD milliseconds)
     }
 
     if (m_type == wxMUTEX_DEFAULT)
-    { 
+    {
         // required for checking recursiveness
         m_owningThread = wxThread::GetCurrentId();
     }
-    
+
     return wxMUTEX_NO_ERROR;
 }
 
@@ -333,7 +328,7 @@ public:
 private:
     HANDLE m_semaphore;
 
-    DECLARE_NO_COPY_CLASS(wxSemaphoreInternal)
+    wxDECLARE_NO_COPY_CLASS(wxSemaphoreInternal);
 };
 
 wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount)
@@ -512,7 +507,7 @@ private:
     // reaches 0 we kill the owning wxThread -- and die ourselves with it
     LONG m_nRef;
 
-    DECLARE_NO_COPY_CLASS(wxThreadInternal)
+    wxDECLARE_NO_COPY_CLASS(wxThreadInternal);
 };
 
 // small class which keeps a thread alive during its lifetime