Fixed race condition bug in tinythread

This commit is contained in:
Thulinma 2016-09-21 12:30:54 +02:00
parent b6f606bf87
commit 9e9e5685b4

View file

@ -169,8 +169,10 @@ namespace tthread {
// The thread is no longer executing
if (ti->mThread) {
lock_guard<mutex> guard(ti->mThread->mDataMutex);
ti->mThread->mNotAThread = true;
ti->mThread->ti_copy = 0;
if (ti->mThread){
ti->mThread->mNotAThread = true;
ti->mThread->ti_copy = 0;
}
}
// The thread is responsible for freeing the startup information