summaryrefslogtreecommitdiff
path: root/libs/utils/Threads.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2013-03-11 14:34:56 -0700
committer Romain Guy <romainguy@google.com> 2013-03-11 14:34:56 -0700
commit9447be65c34b66b01a19a85f4b07bb9c685e847a (patch)
tree9c1d7f892971ad0dfc63b34ff1ce287d554c26ef /libs/utils/Threads.cpp
parent175264b09c6080b29a23fc9f545d4b99445714bd (diff)
Add Thread::isRunning and Condition::signal(WakeUpType)
The signal() method is useful to choose whether to wake up one or all threads. Change-Id: I062ab6d3ddd306a9fb735549ea140e2a76eed75a
Diffstat (limited to 'libs/utils/Threads.cpp')
-rw-r--r--libs/utils/Threads.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index a25a81fbeb..1d61457b48 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -871,6 +871,11 @@ status_t Thread::join()
return mStatus;
}
+bool Thread::isRunning() const {
+ Mutex::Autolock _l(mLock);
+ return mRunning;
+}
+
#ifdef HAVE_ANDROID_OS
pid_t Thread::getTid() const
{