diff --git a/src/OpenThreads/pthreads/PThread.cpp b/src/OpenThreads/pthreads/PThread.cpp index 3bec4ffbc..965514a23 100644 --- a/src/OpenThreads/pthreads/PThread.cpp +++ b/src/OpenThreads/pthreads/PThread.cpp @@ -638,6 +638,12 @@ bool Thread::isRunning() // int Thread::start() { + PThreadPrivateData *pd = static_cast (_prvData); + if (pd->isRunning()) + { + return 0; + } + int status; pthread_attr_t thread_attr; @@ -647,8 +653,6 @@ int Thread::start() { return status; } - PThreadPrivateData *pd = static_cast (_prvData); - //------------------------------------------------------------------------- // Set the stack size if requested, but not less than a platform reasonable // value. diff --git a/src/OpenThreads/win32/Win32Thread.cpp b/src/OpenThreads/win32/Win32Thread.cpp index 9ade67eb7..3444b6b2b 100644 --- a/src/OpenThreads/win32/Win32Thread.cpp +++ b/src/OpenThreads/win32/Win32Thread.cpp @@ -336,6 +336,11 @@ bool Thread::isRunning() { int Thread::start() { Win32ThreadPrivateData *pd = static_cast (_prvData); + if (pd->isRunning) + { + return 0; + } + //------------------------------------------------------------------------- // Prohibit the stack size from being changed. // (bb 5/13/2005) it actually doesn't matter.