Skip to content

Commit 2d9299b

Browse files
Ritu SrivastavaMadan Ankapura
authored andcommitted
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>
1 parent e59e030 commit 2d9299b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libs/utils/Threads.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ int Thread::_threadLoop(void* user)
775775
self->mLock.lock();
776776
self->mRunning = false;
777777
self->mThreadExitedCondition.broadcast();
778+
self->mThread = thread_id_t(-1); // thread id could be reused
778779
self->mLock.unlock();
779780
break;
780781
}

0 commit comments

Comments
 (0)