// Purpose: wxThread (Posix) Implementation
// Author: Original from Wolfram Gloger/Guilhem Lavaux
// Modified by: K. S. Sreeram (2002): POSIXified wxCondition, added wxSemaphore
// Purpose: wxThread (Posix) Implementation
// Author: Original from Wolfram Gloger/Guilhem Lavaux
// Modified by: K. S. Sreeram (2002): POSIXified wxCondition, added wxSemaphore
// on some systems pthread_mutexattr_settype() is not in the headers (but it is
// in the library, otherwise we wouldn't compile this code at all)
extern "C" int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
// on some systems pthread_mutexattr_settype() is not in the headers (but it is
// in the library, otherwise we wouldn't compile this code at all)
extern "C" int pthread_mutexattr_settype(pthread_mutexattr_t *, int);
bool WasCancelled() const { return m_cancelled; }
// exit code
void SetExitCode(wxThread::ExitCode exitcode) { m_exitcode = exitcode; }
bool WasCancelled() const { return m_cancelled; }
// exit code
void SetExitCode(wxThread::ExitCode exitcode) { m_exitcode = exitcode; }
- // NB: at least under Linux, pthread_cleanup_push/pop are macros and pop
- // contains the matching '}' for the '{' in push, so they must be used
- // in the same block!
+ // NB: pthread_cleanup_push/pop() are macros and pop contains the matching
+ // '}' for the '{' in push, so they must be used in the same block!
{
wxCriticalSectionLocker lock(thread->m_critsect);
if ( thread->m_internal->GetState() == STATE_EXITED )
{
wxCriticalSectionLocker lock(thread->m_critsect);
if ( thread->m_internal->GetState() == STATE_EXITED )
// we make it a global object, but this would mean that we can
// only call one thread function at a time :-(
DeleteThread(this);
// we make it a global object, but this would mean that we can
// only call one thread function at a time :-(
DeleteThread(this);
// leave the crit section or the other threads will stop too if they
// try to call any of (seemingly harmless) IsXXX() functions while we
// leave the crit section or the other threads will stop too if they
// try to call any of (seemingly harmless) IsXXX() functions while we