// RCS-ID: $Id$
// Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998),
// Vadim Zeitlin (1999) , Stefan Csomor (2000)
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
- #pragma implementation "thread.h"
-#endif
-
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
wxMacStCritical()
{
if ( UMASystemIsInitialized() )
- ThreadBeginCritical() ;
+ {
+ OSErr err = ThreadBeginCritical() ;
+ wxASSERT( err == noErr ) ;
+ }
}
~wxMacStCritical()
{
if ( UMASystemIsInitialized() )
- ThreadEndCritical() ;
+ {
+ OSErr err = ThreadEndCritical() ;
+ wxASSERT( err == noErr ) ;
+ }
}
};
m_waiters.Add(current);
err = ::SetThreadStateEndCritical(kCurrentThreadID, kStoppedThreadState, m_owner);
err = ::ThreadBeginCritical();
+ wxASSERT( err == noErr ) ;
}
m_owner = current;
}
{
OSErr err;
err = ::ThreadBeginCritical();
+ wxASSERT( err == noErr ) ;
if (m_locked > 0)
m_locked--;
{
OSErr err ;
- ::ThreadBeginCritical();
+ err = ::ThreadBeginCritical();
+ wxASSERT( err == noErr ) ;
if ( m_state != STATE_RUNNING )
{
- ::ThreadEndCritical() ;
+ err = ::ThreadEndCritical() ;
+ wxASSERT( err == noErr ) ;
wxLogSysError(_("Can not suspend thread %x"), m_tid);
return FALSE;
}
wxASSERT( err == noErr ) ;
wxASSERT( current != m_tid ) ;
- ::ThreadBeginCritical();
+ err = ::ThreadBeginCritical();
+ wxASSERT( err == noErr ) ;
+
if ( m_state != STATE_PAUSED && m_state != STATE_NEW )
{
- ::ThreadEndCritical() ;
+ err = ::ThreadEndCritical() ;
+ wxASSERT( err == noErr ) ;
wxLogSysError(_("Can not resume thread %x"), m_tid);
return FALSE;
}
err = ::SetThreadStateEndCritical(m_tid, kReadyThreadState, kNoThreadID);
- wxASSERT( err == noErr ) ;
m_state = STATE_RUNNING;
- ::ThreadEndCritical() ;
+ err = ::ThreadEndCritical() ;
+ wxASSERT( err == noErr ) ;
::YieldToAnyThread() ;
return TRUE;
}