]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
moved splines rendering code into wxDCBase
[wxWidgets.git] / src / mac / carbon / app.cpp
index 6d077eb60d705d047774462800a4c5e6c4184611..97c3590a5e426afb2a463763be5412a0d5f1f51e 100644 (file)
@@ -855,12 +855,22 @@ void wxCYield()
 }
 
 // Yield to other processes
+
+static bool gs_inYield = FALSE;
+
 bool wxYield()
 {
+#ifdef __WXDEBUG__    
+    if (gs_inYield)
+        wxFAIL_MSG( wxT("wxYield called recursively" ) );
+#endif
+
+    gs_inYield = TRUE;
+    
 #if wxUSE_THREADS
-  YieldToAnyThread() ;
+    YieldToAnyThread() ;
 #endif
-  EventRecord event ;
+    EventRecord event ;
 
        long sleepTime = 0 ; //::GetCaretTime();
 
@@ -870,7 +880,19 @@ bool wxYield()
        }
 
        wxMacProcessNotifierAndPendingEvents() ;
-  return TRUE;
+
+    gs_inYield = FALSE;
+    
+    return TRUE;
+}
+
+// Yield to incoming messages; but fail silently if recursion is detected.
+bool wxYieldIfNeeded()
+{
+    if (gs_inYield)
+        return FALSE;
+        
+    return wxYield();
 }
 
 // platform specifics