Added check if thraeding is running before executing start thread.
This commit is contained in:
parent
6b037372b6
commit
862c36a08b
@ -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.
|
||||
|
@ -334,6 +334,11 @@ bool Thread::isRunning() {
|
||||
int Thread::start() {
|
||||
|
||||
Win32ThreadPrivateData *pd = static_cast<Win32ThreadPrivateData *> (_prvData);
|
||||
if (pd->isRunning)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Prohibit the stack size from being changed.
|
||||
// (bb 5/13/2005) it actually doesn't matter.
|
||||
|
Loading…
Reference in New Issue
Block a user