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);
}
return ::GetCurrentThreadId() == s_idMainThread;
}
+#ifdef Yield
+#undef Yield
+#endif
+
void wxThread::Yield()
{
// 0 argument to Sleep() is special