-} // extern "C"
-
-void wxapp_install_idle_handler()
-{
-#if wxUSE_THREADS
- wxMutexLocker lock(gs_idleTagsMutex);
-#endif
-
- // Don't install the handler if it's already installed. This test *MUST*
- // be done when gs_idleTagsMutex is locked!
- if (!g_isIdle)
- return;
-
- // GD: this assert is raised when using the thread sample (which works)
- // so the test is probably not so easy. Can widget callbacks be
- // triggered from child threads and, if so, for which widgets?
- // wxASSERT_MSG( wxThread::IsMain() || gs_WakeUpIdle, wxT("attempt to install idle handler from widget callback in child thread (should be exclusively from wxWakeUpIdle)") );
-
- wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
-
- g_isIdle = false;
-
- // This routine gets called by all event handlers
- // indicating that the idle is over. It may also
- // get called from other thread for sending events
- // to the main thread (and processing these in
- // idle time). Very low priority.
- wxTheApp->m_idleTag = g_idle_add_full(G_PRIORITY_LOW, wxapp_idle_callback, NULL, NULL);
-}
-