diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-09 03:29:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-09 03:29:19 -0700 |
commit | 11c803ac77b6a9b815180b4649a700361d3b8cfe (patch) | |
tree | af550a05e37000fc8bec4508251afff33a64570f /libs | |
parent | 72e2d6da79a2fc3b5346c02ed40b9335c1eb78fa (diff) | |
parent | d42bd87f23974164d2539ea85c7b5e6329faf2c2 (diff) | |
download | frameworks_base-11c803ac77b6a9b815180b4649a700361d3b8cfe.zip frameworks_base-11c803ac77b6a9b815180b4649a700361d3b8cfe.tar.gz frameworks_base-11c803ac77b6a9b815180b4649a700361d3b8cfe.tar.bz2 |
Merge change 24335 into eclair
* changes:
use broadcast() instead of signal() when signaling the condition-variable Thread::RequestExitAndWait() is waiting for
Diffstat (limited to 'libs')
-rw-r--r-- | libs/utils/Threads.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp index 6be372c..ec3db09 100644 --- a/libs/utils/Threads.cpp +++ b/libs/utils/Threads.cpp @@ -655,6 +655,11 @@ int Thread::_threadLoop(void* user) wp<Thread> weak(strong); self->mHoldSelf.clear(); +#if HAVE_ANDROID_OS + // this is very useful for debugging with gdb + self->mTid = gettid(); +#endif + bool first = true; do { @@ -685,7 +690,7 @@ int Thread::_threadLoop(void* user) self->mExitPending = true; self->mLock.lock(); self->mRunning = false; - self->mThreadExitedCondition.signal(); + self->mThreadExitedCondition.broadcast(); self->mLock.unlock(); break; } @@ -693,7 +698,7 @@ int Thread::_threadLoop(void* user) // Release our strong reference, to let a chance to the thread // to die a peaceful death. strong.clear(); - // And immediately, reacquire a strong reference for the next loop + // And immediately, re-acquire a strong reference for the next loop strong = weak.promote(); } while(strong != 0); |