Added check if thraeding is running before executing start thread.
This commit is contained in:
@@ -603,6 +603,12 @@ bool Thread::isRunning()
|
||||
//
|
||||
int Thread::start() {
|
||||
|
||||
PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);
|
||||
if (pd->isRunning())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int status;
|
||||
pthread_attr_t thread_attr;
|
||||
|
||||
@@ -612,8 +618,6 @@ int Thread::start() {
|
||||
return status;
|
||||
}
|
||||
|
||||
PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Set the stack size if requested, but not less than a platform reasonable
|
||||
// value.
|
||||
|
||||
Reference in New Issue
Block a user