wxThread::~wxThread() { #ifdef __WXDEBUG__ m_critsect.Enter(); // check that the thread either exited or couldn't be created if ( m_internal->GetState() != STATE_EXITED && m_internal->GetState() != STATE_NEW ) { wxLogDebug(_T("The thread %ld is being destroyed although it is still running! The application may crash."), (long)GetId()); } m_critsect.Leave(); #endif // __WXDEBUG__ delete m_internal; // remove this thread from the global array { wxMutexLocker lock(*gs_mutexAllThreads); gs_allThreads.Remove(this); } }
wxThread::wxThread(wxThreadKind kind) { // add this thread to the global list of all threads gs_allThreads.Add(this); m_internal = new wxThreadInternal(); m_isDetached = kind == wxTHREAD_DETACHED; }
wxThread::wxThread(wxThreadKind kind) { // add this thread to the global list of all threads { wxMutexLocker lock(*gs_mutexAllThreads); gs_allThreads.Add(this); } m_internal = new wxThreadInternal(); m_isDetached = kind == wxTHREAD_DETACHED; }