fix failing thread object run
A previously exited Thread object refuses to run again, if the thread-id of the caller, conincides with the thread-id it previously used in the worker thread. Hence reset the previously used worker thread-id to -1 when it exits. Signed-off-by: Ritu Srivastava <rsrivast@sta.samsung.com> Change-Id: I873925c312a43ec8a16392b98cc959042ff6bfd2 Signed-off-by: Madan Ankapura <mankapur@sta.samsung.com>
This commit is contained in:
committed by
Madan Ankapura
parent
e59e0309a1
commit
2d9299b39d
@@ -775,6 +775,7 @@ int Thread::_threadLoop(void* user)
|
||||
self->mLock.lock();
|
||||
self->mRunning = false;
|
||||
self->mThreadExitedCondition.broadcast();
|
||||
self->mThread = thread_id_t(-1); // thread id could be reused
|
||||
self->mLock.unlock();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user