+void wxGUIEventLoop::OnNextIteration()
+{
+#if wxUSE_THREADS
+ wxMutexGuiLeaveOrEnter();
+#endif // wxUSE_THREADS
+}
+
+void wxGUIEventLoop::WakeUp()
+{
+ ::PostMessage(NULL, WM_NULL, 0, 0);
+}
+
+#else // !wxUSE_GUI
+
+#if wxUSE_CONSOLE_EVENTLOOP
+
+void wxConsoleEventLoop::OnNextIteration()
+{
+ if ( wxTheApp )
+ wxTheApp->ProcessPendingEvents();
+}
+
+void wxConsoleEventLoop::WakeUp()
+{
+#if wxUSE_THREADS
+ wxWakeUpMainThread();
+#endif
+}
+
+bool wxConsoleEventLoop::Dispatch()
+{
+ MSG msg;
+ if ( !GetNextMessage(&msg) )
+ return false;
+
+ if ( msg.message == WM_TIMER )
+ {
+ TIMERPROC proc = (TIMERPROC)msg.lParam;
+ if ( proc )
+ (*proc)(NULL, 0, msg.wParam, 0);
+ }
+ else
+ {
+ ::DispatchMessage(&msg);
+ }
+
+ return !m_shouldExit;
+}
+
+#endif // wxUSE_CONSOLE_EVENTLOOP
+
+#endif //wxUSE_GUI