X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e7d70ef0e33c1dfddd42a9d9383dd1ec2e2a9a77..aa78d22e2008726218d47da1f2ac5864c11b8ebb:/src/os2/evtloop.cpp diff --git a/src/os2/evtloop.cpp b/src/os2/evtloop.cpp index 4e3a117288..8ed9c42574 100644 --- a/src/os2/evtloop.cpp +++ b/src/os2/evtloop.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma implementation "evtloop.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -87,30 +83,6 @@ private: wxDEFINE_TIED_SCOPED_PTR_TYPE(wxEventLoopImpl); -// this object sets the wxEventLoop given to the ctor as the currently active -// one and unsets it in its dtor -class wxEventLoopActivator -{ -public: - wxEventLoopActivator(wxEventLoop **pActive, - wxEventLoop *evtLoop) - { - m_pActive = pActive; - m_evtLoopOld = *pActive; - *pActive = evtLoop; - } - - ~wxEventLoopActivator() - { - // restore the previously active event loop - *m_pActive = m_evtLoopOld; - } - -private: - wxEventLoop *m_evtLoopOld; - wxEventLoop **m_pActive; -}; - // ============================================================================ // wxEventLoopImpl implementation // ============================================================================ @@ -227,8 +199,6 @@ bool wxEventLoopImpl::SendIdleMessage() // wxEventLoop implementation // ============================================================================ -wxEventLoop *wxEventLoop::ms_activeLoop = NULL; - // ---------------------------------------------------------------------------- // wxEventLoop running and exiting // ---------------------------------------------------------------------------- @@ -238,11 +208,6 @@ wxEventLoop::~wxEventLoop() wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") ); } -bool wxEventLoop::IsRunning() const -{ - return m_impl != NULL; -} - ////////////////////////////////////////////////////////////////////////////// // // Keep trying to process messages until WM_QUIT @@ -280,7 +245,7 @@ int wxEventLoop::Run() // SendIdleMessage() and Dispatch() below may throw so the code here should // be exception-safe, hence we must use local objects for all actions we // should undo - wxEventLoopActivator activate(&ms_activeLoop, this); + wxEventLoopActivator activate(this); wxEventLoopImplTiedPtr impl(&m_impl, new wxEventLoopImpl); CallEventLoopMethod callOnExit(this, &wxEventLoop::OnExit); @@ -296,7 +261,7 @@ int wxEventLoop::Run() while ( !Pending() && m_impl->SendIdleMessage() ) { wxTheApp->HandleSockets(); - wxUsleep(10); + wxMilliSleep(10); } wxTheApp->HandleSockets(); @@ -309,7 +274,7 @@ int wxEventLoop::Run() } } else - wxUsleep(10); + wxMilliSleep(10); } return m_impl->GetExitCode();