summaryrefslogtreecommitdiff
path: root/libs/binder/IPCThreadState.cpp
diff options
context:
space:
mode:
author Brad Fitzpatrick <bradfitz@android.com> 2010-12-13 16:52:35 -0800
committer Brad Fitzpatrick <bradfitz@android.com> 2010-12-14 09:28:16 -0800
commit0bd5243b751c9cad317758158f79b3347e7948af (patch)
tree0c019af51a9067ae0292b6e0cf95c0829539c83d /libs/binder/IPCThreadState.cpp
parent48ea8d836276c04528d8e7dfebd59d27a627ce66 (diff)
Framework-side support for Dalvik "isSensitiveThread" hook.
Used in lock contention stats. Bug: 3226270 Change-Id: Ie6f58d130a29079a59bdefad40b80304d9bc3623
Diffstat (limited to 'libs/binder/IPCThreadState.cpp')
-rw-r--r--libs/binder/IPCThreadState.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index 13c58f04fcb1..95cfddf758f2 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -318,6 +318,16 @@ restart:
goto restart;
}
+IPCThreadState* IPCThreadState::selfOrNull()
+{
+ if (gHaveTLS) {
+ const pthread_key_t k = gTLS;
+ IPCThreadState* st = (IPCThreadState*)pthread_getspecific(k);
+ return st;
+ }
+ return NULL;
+}
+
void IPCThreadState::shutdown()
{
gShutdown = true;