// (politely, this is not Kill()!) to do it
wxThreadError WaitForTerminate(wxCriticalSection& cs,
wxThread::ExitCode *pRc,
+ wxThreadWait waitMode,
wxThread *threadToDelete = NULL);
// kill the thread unconditionally
wxThreadError
wxThreadInternal::WaitForTerminate(wxCriticalSection& cs,
wxThread::ExitCode *pRc,
+ wxThreadWait waitMode,
wxThread *threadToDelete)
{
// prevent the thread C++ object from disappearing as long as we are using
wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
if ( traits )
{
- result = traits->WaitForThread(m_hThread);
+ result = traits->WaitForThread(m_hThread, waitMode);
}
else // can't wait for the thread
{
// stopping thread
// ---------------
-wxThread::ExitCode wxThread::Wait()
+wxThread::ExitCode wxThread::Wait(wxThreadWait waitMode)
{
ExitCode rc = wxUIntToPtr(THREAD_ERROR_EXIT);
wxCHECK_MSG( !IsDetached(), rc,
wxT("wxThread::Wait(): can't wait for detached thread") );
- (void)m_internal->WaitForTerminate(m_critsect, &rc);
+ (void)m_internal->WaitForTerminate(m_critsect, &rc, waitMode);
return rc;
}
-wxThreadError wxThread::Delete(ExitCode *pRc)
+wxThreadError wxThread::Delete(ExitCode *pRc, wxThreadWait waitMode)
{
- return m_internal->WaitForTerminate(m_critsect, pRc, this);
+ return m_internal->WaitForTerminate(m_critsect, pRc, waitMode, this);
}
wxThreadError wxThread::Kill()