HANDLE m_mutex;
unsigned long m_owningThread;
- bool m_isLocked;
wxMutexType m_type;
DECLARE_NO_COPY_CLASS(wxMutexInternal)
m_type = mutexType;
m_owningThread = 0;
- m_isLocked = false;
if ( !m_mutex )
{
if (m_type == wxMUTEX_DEFAULT)
{
// Don't allow recursive
- if (m_isLocked)
+ if (m_owningThread != 0)
{
if (m_owningThread == wxThread::GetCurrentId())
return wxMUTEX_DEAD_LOCK;
if (m_type == wxMUTEX_DEFAULT)
{
// required for checking recursiveness
- m_isLocked = true;
m_owningThread = wxThread::GetCurrentId();
}
wxMutexError wxMutexInternal::Unlock()
{
+ // required for checking recursiveness
+ m_owningThread = 0;
+
if ( !::ReleaseMutex(m_mutex) )
{
wxLogLastError(_T("ReleaseMutex()"));
return wxMUTEX_MISC_ERROR;
}
-
- // required for checking recursiveness
- m_isLocked = false;
return wxMUTEX_NO_ERROR;
}