X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c51a665c649f7579fb39e62070cef4f66b3210d..b5ec0c78b521cfa0f276e4d5d830f35b4fa26e91:/src/os2/thread.cpp?ds=inline diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index d1ee5dc364..b17b17cb83 100644 --- a/src/os2/thread.cpp +++ b/src/os2/thread.cpp @@ -354,7 +354,7 @@ public: { m_hThread = 0; m_eState = STATE_NEW; - m_nPriority = WXTHREAD_DEFAULT_PRIORITY; + m_nPriority = wxPRIORITY_DEFAULT; } ~wxThreadInternal() @@ -497,7 +497,7 @@ bool wxThreadInternal::Create( wxThread* pThread, return false; } m_hThread = tid; - if (m_nPriority != WXTHREAD_DEFAULT_PRIORITY) + if (m_nPriority != wxPRIORITY_DEFAULT) { SetPriority(m_nPriority); } @@ -626,6 +626,14 @@ wxThreadError wxThread::Run() { wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); + // Create the thread if it wasn't created yet with an explicit + // Create() call: + if ( !m_internal->GetHandle() ) + { + if ( !m_internal->Create(this, 0) ) + return wxTHREAD_NO_RESOURCE; + } + if ( m_internal->GetState() != STATE_NEW ) { // actually, it may be almost any state at all, not only STATE_RUNNING