summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eric Laurent <elaurent@google.com> 2011-01-13 11:59:13 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2011-01-13 11:59:13 -0800
commit8eff45242180c7dec2b437c3929cb7ea3345f60c (patch)
treecbe1b3f0147ebb19375d3d0a2ca56b86b09e1bb9
parent9aba2324ac8d7216732b42346bfcaf0be71eb22e (diff)
parent41f4d4d84790f49a0771c3ebfd12d87a5b879f94 (diff)
Merge "Fix issue 3302649." into honeycomb
-rw-r--r--libs/utils/Threads.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index f6c55e4d89de..ad9a94f594f5 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -774,6 +774,9 @@ int Thread::_threadLoop(void* user)
self->mExitPending = true;
self->mLock.lock();
self->mRunning = false;
+ // clear thread ID so that requestExitAndWait() does not exit if
+ // called by a new thread using the same thread ID as this one.
+ self->mThread = thread_id_t(-1);
self->mThreadExitedCondition.broadcast();
self->mLock.unlock();
break;