From 5ee1a0c5ee41a9c7366e7e378e5ab232072bb983 Mon Sep 17 00:00:00 2001 From: Ritu Srivastava Date: Tue, 25 Jan 2011 16:23:08 -0800 Subject: [PATCH] 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 Change-Id: I873925c312a43ec8a16392b98cc959042ff6bfd2 Signed-off-by: Madan Ankapura --- libs/utils/Threads.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp index f6c55e4d8..0b360f45b 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; }