X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f7c44a6a163799b19c234b9b9362afa50bbf5bbf..c16e5a9271ab576a76c8537b67e0f5e25f90bc67:/src/msw/thread.cpp?ds=sidebyside diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 3ee7c1149a..c3703a0456 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -257,29 +257,22 @@ private: wxCriticalSection::wxCriticalSection() { - m_critsect = NULL; + m_critsect = new wxCriticalSectionInternal; } wxCriticalSection::~wxCriticalSection() { - wxASSERT_MSG( !m_critsect, "Forgot to Leave() critical section" ); + delete m_critsect; } void wxCriticalSection::Enter() { - m_critsect = new wxCriticalSectionInternal; - ::EnterCriticalSection(*m_critsect); } void wxCriticalSection::Leave() { - wxCHECK_RET( m_critsect, "Leave() without matching Enter()" ); - ::LeaveCriticalSection(*m_critsect); - - delete m_critsect; - m_critsect = NULL; } // ---------------------------------------------------------------------------- @@ -447,6 +440,10 @@ bool wxThread::IsMain() return ::GetCurrentThreadId() == s_idMainThread; } +#ifdef Yield +#undef Yield +#endif + void wxThread::Yield() { // 0 argument to Sleep() is special