APIRET ulrc = ::DosCreateMutexSem(NULL, &m_vMutex, 0L, FALSE);
if (ulrc != 0)
{
APIRET ulrc = ::DosCreateMutexSem(NULL, &m_vMutex, 0L, FALSE);
if (ulrc != 0)
{
+ // 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
if ( m_internal->GetState() != STATE_NEW )
{
// actually, it may be almost any state at all, not only STATE_RUNNING
{
// although under Windows we can wait for any thread, it's an error to
// wait for a detached one in wxWin API
wxCHECK_MSG( !IsDetached(), (ExitCode)-1,
wxT("can't wait for detached thread") );
ExitCode rc = (ExitCode)-1;
{
// although under Windows we can wait for any thread, it's an error to
// wait for a detached one in wxWin API
wxCHECK_MSG( !IsDetached(), (ExitCode)-1,
wxT("can't wait for detached thread") );
ExitCode rc = (ExitCode)-1;