+//-----------------------------------------------------------------------------
+// wxYieldIfNeeded
+// Like wxYield, but fails silently if the yield is recursive.
+//-----------------------------------------------------------------------------
+
+bool wxYieldIfNeeded()
+{
+ if (gs_inYield)
+ return FALSE;
+
+ return wxYield();
+}
+
+//-----------------------------------------------------------------------------
+// wxWakeUpIdle
+//-----------------------------------------------------------------------------
+
+void wxWakeUpIdle()
+{
+#if wxUSE_THREADS
+ if (!wxThread::IsMain())
+ wxMutexGuiEnter();
+#endif
+
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+#if wxUSE_THREADS
+ if (!wxThread::IsMain())
+ wxMutexGuiLeave();
+#endif
+}
+
+//-----------------------------------------------------------------------------
+// local functions
+//-----------------------------------------------------------------------------
+
+gint wxapp_pending_callback( gpointer WXUNUSED(data) )
+{
+ if (!wxTheApp) return TRUE;
+
+ // when getting called from GDK's time-out handler
+ // we are no longer within GDK's grab on the GUI
+ // thread so we must lock it here ourselves
+ gdk_threads_enter();
+
+ // Sent idle event to all who request them
+ wxTheApp->ProcessPendingEvents();
+
+ g_pendingTag = 0;
+
+ /* flush the logged messages if any */
+#if wxUSE_LOG
+ wxLog::FlushActive();
+#endif // wxUSE_LOG
+
+ // Release lock again
+ gdk_threads_leave();
+
+ // Return FALSE to indicate that no more idle events are
+ // to be sent (single shot instead of continuous stream)
+ return FALSE;
+}
+