summaryrefslogtreecommitdiff
path: root/libs/utils/Threads.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/utils/Threads.cpp')
-rw-r--r--libs/utils/Threads.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index 6be372c87ea0..ec3db0980d39 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);