]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/thread.cpp
cleanup - reformat
[wxWidgets.git] / src / mac / carbon / thread.cpp
index 6c477b3685b804d0cbf4714b14c731c60d22fa06..e54779628dffe727512d07575f9dc41b3255fe00 100644 (file)
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "thread.h"
-#endif
-
 // ----------------------------------------------------------------------------
 // headers
 // ----------------------------------------------------------------------------
 #include "wx/thread.h"
 
 #ifdef __WXMAC__
-#if TARGET_API_MAC_OSX
+#ifdef __DARWIN__
 #include <CoreServices/CoreServices.h>
 #else
 #include <DriverServices.h>
 #include <Multiprocessing.h>
-#include <math.h>
+#include "wx/math.h"
 #endif
 #include "wx/mac/uma.h"
 #endif
@@ -1171,7 +1167,7 @@ void wxThreadInternal::Wait()
                                 kDurationForever);
             if ( err)
             {
-                wxLogSysError( _( "Cannot wait on thread to exit."));
+                wxLogSysError( _( "Cannot wait for thread termination."));
                 rc = (void*) -1;
             }
 
@@ -1638,7 +1634,7 @@ bool wxThreadModule::OnInit()
        
        verify_noerr( MPAllocateTaskStorageIndex( &gs_tlsForWXThread ) ) ;
        // main thread's This() is NULL
-       verify_noerr( MPSetTaskStorageValue( gs_tlsForWXThread , NULL ) ) ;
+       verify_noerr( MPSetTaskStorageValue( gs_tlsForWXThread , 0 ) ) ;
 
        gs_idMainThread = wxThread::GetCurrentId() ;
        
@@ -1721,6 +1717,9 @@ void WXDLLIMPEXP_BASE wxMutexGuiLeaveOrEnter()
     wxASSERT_MSG( wxThread::IsMain(),
                   wxT("only main thread may call wxMutexGuiLeaveOrEnter()!") );
 
+    if( !gs_critsectWaitingForGui )
+        return;
+        
     wxCriticalSectionLocker enter(*gs_critsectWaitingForGui);
 
     if ( gs_nWaitingForGui == 0 )