]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/thread.cpp
fixed a few minor bugs: handle the directory parameter to Create() correctly, better...
[wxWidgets.git] / src / mac / thread.cpp
index 69a6e85003c47e78e9195d7f54e42f3a3f433ccd..88f837d669ea70fc2a57655955941fac9e6b2095 100644 (file)
@@ -35,9 +35,7 @@
 #include "wx/thread.h"
 
 #ifdef __WXMAC__
-#ifndef __DARWIN__
 #include <Threads.h>
-#endif
 #include "wx/mac/uma.h"
 #endif
 
@@ -207,7 +205,7 @@ wxMutexError wxMutex::Unlock()
 class wxConditionInternal
 {
 public:
-    wxConditionInternal()
+    wxConditionInternal(wxMutex& mutex) : m_mutex(mutex)
     {
         m_excessSignals = 0 ;
     }
@@ -249,11 +247,12 @@ public:
 
     wxArrayLong m_waiters ;
     wxInt32     m_excessSignals ;
+    wxMutex&    m_mutex;
 };
 
-wxCondition::wxCondition()
+wxCondition::wxCondition(wxMutex& mutex)
 {
-    m_internal = new wxConditionInternal;
+    m_internal = new wxConditionInternal(mutex);
 }
 
 wxCondition::~wxCondition()
@@ -266,10 +265,9 @@ void wxCondition::Wait()
     (void)m_internal->Wait(0xFFFFFFFFL);
 }
 
-bool wxCondition::Wait(unsigned long sec,
-                       unsigned long nsec)
+bool wxCondition::Wait(unsigned long timeout_millis)
 {
-    return m_internal->Wait(sec*1000 + nsec/1000000);
+    return m_internal->Wait(timeout_millis);
 }
 
 void wxCondition::Signal()