Fixed race condition bug in tinythread
This commit is contained in:
parent
b6f606bf87
commit
9e9e5685b4
1 changed files with 4 additions and 2 deletions
|
@ -169,9 +169,11 @@ namespace tthread {
|
||||||
// The thread is no longer executing
|
// The thread is no longer executing
|
||||||
if (ti->mThread) {
|
if (ti->mThread) {
|
||||||
lock_guard<mutex> guard(ti->mThread->mDataMutex);
|
lock_guard<mutex> guard(ti->mThread->mDataMutex);
|
||||||
|
if (ti->mThread){
|
||||||
ti->mThread->mNotAThread = true;
|
ti->mThread->mNotAThread = true;
|
||||||
ti->mThread->ti_copy = 0;
|
ti->mThread->ti_copy = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The thread is responsible for freeing the startup information
|
// The thread is responsible for freeing the startup information
|
||||||
delete ti;
|
delete ti;
|
||||||
|
|
Loading…
Add table
Reference in a new issue