X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/00fdc89da8987c07e4aa2c94bfef7bd0bd793b48..26ac40202f84fd07c9f24885b4d36b34b9468f4d:/src/msw/thread.cpp diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 8028e928e1..c3703a0456 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -257,26 +257,21 @@ private: wxCriticalSection::wxCriticalSection() { - m_critsect = NULL; + m_critsect = new wxCriticalSectionInternal; } wxCriticalSection::~wxCriticalSection() { - if ( m_critsect ) - delete m_critsect; + 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); } @@ -445,6 +440,10 @@ bool wxThread::IsMain() return ::GetCurrentThreadId() == s_idMainThread; } +#ifdef Yield +#undef Yield +#endif + void wxThread::Yield() { // 0 argument to Sleep() is special