]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxApp::Yield
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 20 Oct 2001 22:07:13 +0000 (22:07 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 20 Oct 2001 22:07:13 +0000 (22:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12119 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mgl/app.h
src/mgl/app.cpp

index b3b0b6ca67a522bc4916c78e5ad45215651c88b0..bc57b0ae9efe97caa879eca94192d0d8b4a2f9bd 100644 (file)
@@ -61,6 +61,8 @@ public:
     bool ProcessIdle();
     void DeletePendingObjects();
 
+    virtual bool Yield(bool onlyIfNeeded = FALSE);
+
 private:
     DECLARE_DYNAMIC_CLASS(wxApp)
     DECLARE_EVENT_TABLE()
index bb061200c3f9d826c5407e080ce21f09511a8aea..a5aba35432a1b58358c0a690276568e7d97b5c35 100644 (file)
@@ -65,8 +65,18 @@ void wxExit()
 
 static bool gs_inYield = FALSE;
 
-bool wxYield()
+bool wxApp::Yield(bool onlyIfNeeded)
 {
+    if ( gs_inYield )
+    {
+        if ( !onlyIfNeeded )
+        {
+            wxFAIL_MSG( wxT("wxYield called recursively" ) );
+        }
+
+        return FALSE;
+    }
+
 #if wxUSE_THREADS
     if ( !wxThread::IsMain() )
     {
@@ -97,14 +107,6 @@ bool wxYield()
     return TRUE;
 }
 
-bool wxYieldIfNeeded()
-{
-    if (gs_inYield)
-        return FALSE;
-
-    return wxYield();
-}
-
 
 //-----------------------------------------------------------------------------
 // wxWakeUpIdle