]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/thread.cpp
Moved the cleanup code to an EVT_WINDOW_DESTROY handler.
[wxWidgets.git] / src / mac / thread.cpp
index e59ca72ebeafcb49ebad5653f7408851acbf8c91..88f837d669ea70fc2a57655955941fac9e6b2095 100644 (file)
@@ -205,7 +205,7 @@ wxMutexError wxMutex::Unlock()
 class wxConditionInternal
 {
 public:
-    wxConditionInternal()
+    wxConditionInternal(wxMutex& mutex) : m_mutex(mutex)
     {
         m_excessSignals = 0 ;
     }
@@ -247,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()
@@ -264,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()