diff options
| author | 2010-12-13 16:52:35 -0800 | |
|---|---|---|
| committer | 2010-12-14 09:28:16 -0800 | |
| commit | 1b6084354710ca52c04ea361d751d19174802d57 (patch) | |
| tree | 9352b42604e36859861d70ccaf6bea0599e0911a /libs/binder/IPCThreadState.cpp | |
| parent | f5da3fd78ab2c1fc13280784288494aaf619cc0f (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.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index 13c58f04fc..95cfddf758 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; |