]> git.saurik.com Git - wxWidgets.git/commitdiff
temp (?) fix for wxYield() calls from other threads
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 19 Feb 2001 12:29:39 +0000 (12:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 19 Feb 2001 12:29:39 +0000 (12:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/app.cpp
src/gtk1/app.cpp

index e7345fe6a9686827ca2f14b5a5709df00ec0a207..e29797d061470572dbe7d4d4f45f64411b7754dd 100644 (file)
@@ -82,6 +82,14 @@ void wxExit()
 
 bool wxYield()
 {
+#if wxUSE_THREADS
+    if ( !wxThread::IsMain() )
+    {
+        // can't call gtk_main_iteration() from other threads like this
+        return TRUE;
+    }
+#endif // wxUSE_THREADS
+
 #ifdef __WXDEBUG__
     static bool s_inYield = FALSE;
     
index e7345fe6a9686827ca2f14b5a5709df00ec0a207..e29797d061470572dbe7d4d4f45f64411b7754dd 100644 (file)
@@ -82,6 +82,14 @@ void wxExit()
 
 bool wxYield()
 {
+#if wxUSE_THREADS
+    if ( !wxThread::IsMain() )
+    {
+        // can't call gtk_main_iteration() from other threads like this
+        return TRUE;
+    }
+#endif // wxUSE_THREADS
+
 #ifdef __WXDEBUG__
     static bool s_inYield = FALSE;