Added check if thraeding is running before executing start thread.
This commit is contained in:
parent
7e476c6f63
commit
20cbb25cd1
@ -638,6 +638,12 @@ bool Thread::isRunning()
|
|||||||
//
|
//
|
||||||
int Thread::start() {
|
int Thread::start() {
|
||||||
|
|
||||||
|
PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);
|
||||||
|
if (pd->isRunning())
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int status;
|
int status;
|
||||||
pthread_attr_t thread_attr;
|
pthread_attr_t thread_attr;
|
||||||
|
|
||||||
@ -647,8 +653,6 @@ int Thread::start() {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Set the stack size if requested, but not less than a platform reasonable
|
// Set the stack size if requested, but not less than a platform reasonable
|
||||||
// value.
|
// value.
|
||||||
|
@ -336,6 +336,11 @@ bool Thread::isRunning() {
|
|||||||
int Thread::start() {
|
int Thread::start() {
|
||||||
|
|
||||||
Win32ThreadPrivateData *pd = static_cast<Win32ThreadPrivateData *> (_prvData);
|
Win32ThreadPrivateData *pd = static_cast<Win32ThreadPrivateData *> (_prvData);
|
||||||
|
if (pd->isRunning)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Prohibit the stack size from being changed.
|
// Prohibit the stack size from being changed.
|
||||||
// (bb 5/13/2005) it actually doesn't matter.
|
// (bb 5/13/2005) it actually doesn't matter.
|
||||||
|
Loading…
Reference in New Issue
Block a user