X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90e95e61175953284a40c73f1d62ccc18ef4c748..ee3dd6dd5f7f4e081ae9a5ead179d0ca5b752759:/src/os2/thread.cpp?ds=sidebyside diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index 830595af2a..94bff21e7c 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 ///////////////////////////////////////////////////////////////////////////// @@ -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