summaryrefslogtreecommitdiff
path: root/libs/utils/Threads.cpp
diff options
context:
space:
mode:
author Ritu Srivastava <rsrivast@sta.samsung.com> 2011-01-25 16:23:08 -0800
committer Madan Ankapura <mankapur@sta.samsung.com> 2011-01-25 21:48:54 -0800
commit2d9299b39d4802a68bfd083a06de347bf1c0721d (patch)
treefc298c640dd3543014caba479459057a58659fb7 /libs/utils/Threads.cpp
parente59e0309a1301908eae0075db02413fda90848d5 (diff)
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>
Diffstat (limited to 'libs/utils/Threads.cpp')
-rw-r--r--libs/utils/Threads.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index f6c55e4d89de..0b360f45bde6 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -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;
}