summaryrefslogtreecommitdiffstats
path: root/include/utils
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2011-02-01 11:32:29 -0800
committerGlenn Kasten <gkasten@google.com>2011-02-23 17:49:59 -0800
commitc2b3cda097d2f8ac9211360aa82995d693e0764c (patch)
tree8a6baf03da30391ff32d3a269df42dda278f701b /include/utils
parent282ff9ae3f798dec325ce6b868f053649b596a8c (diff)
downloadframeworks_base-c2b3cda097d2f8ac9211360aa82995d693e0764c.zip
frameworks_base-c2b3cda097d2f8ac9211360aa82995d693e0764c.tar.gz
frameworks_base-c2b3cda097d2f8ac9211360aa82995d693e0764c.tar.bz2
Bug 3362814 Fix SMP race in access to mRequestExit
Also fix an unlikely SMP race in access to mHoldSelf on entry to _threadLoop. Change-Id: I6cbc0b94739c7dd5e77e8a5ba0da22cdc0b1a4db
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/threads.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/utils/threads.h b/include/utils/threads.h
index 1bcfaed..41e5766 100644
--- a/include/utils/threads.h
+++ b/include/utils/threads.h
@@ -527,9 +527,10 @@ private:
static int _threadLoop(void* user);
const bool mCanCallJava;
thread_id_t mThread;
- Mutex mLock;
+ mutable Mutex mLock;
Condition mThreadExitedCondition;
status_t mStatus;
+ // note that all accesses of mExitPending and mRunning need to hold mLock
volatile bool mExitPending;
volatile bool mRunning;
sp<Thread> mHoldSelf;