X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90e95e61175953284a40c73f1d62ccc18ef4c748..f7f8a13c0466725ffffc0cbe9f10da729c3423dd:/src/os2/thread.cpp diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index 830595af2a..f3277d5332 100644 --- a/src/os2/thread.cpp +++ b/src/os2/thread.cpp @@ -4,7 +4,6 @@ // Author: Original from Wolfram Gloger/Guilhem Lavaux/David Webster // Modified by: Stefan Neis // Created: 04/22/98 -// RCS-ID: $Id$ // Copyright: (c) Stefan Neis (2003) // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -419,7 +418,7 @@ void wxThreadInternal::OS2ThreadStart( void * pParam ) unsigned long ulHab; if (traits) traits->InitializeGui(ulHab); - dwRet = (DWORD)pThread->Entry(); + dwRet = (DWORD)pThread->CallEntry(); if (traits) traits->TerminateGui(ulHab); @@ -626,6 +625,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