summaryrefslogtreecommitdiff
path: root/libs/binder/IPCThreadState.cpp
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2016-02-01 22:29:40 +0000
committer android-build-merger <android-build-merger@google.com> 2016-02-01 22:29:40 +0000
commit35cadd735aa3db14e82e7d492f7f7d64357e915a (patch)
tree84e776c816bc4974286144b32f353d1cbd771c31 /libs/binder/IPCThreadState.cpp
parent4ab1dbe5594b672532db5996dce3b77dbedd7580 (diff)
parente7ae3b1962d0b4cb83ede79f625e75c9d88d35fb (diff)
Merge "Binder: Add log output in IPCThreadState::self()" am: 2be113a248
am: e7ae3b1962 * commit 'e7ae3b1962d0b4cb83ede79f625e75c9d88d35fb': Binder: Add log output in IPCThreadState::self()
Diffstat (limited to 'libs/binder/IPCThreadState.cpp')
-rw-r--r--libs/binder/IPCThreadState.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index a237684783..1f6bda2a94 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -287,12 +287,18 @@ restart:
return new IPCThreadState;
}
- if (gShutdown) return NULL;
+ if (gShutdown) {
+ ALOGW("Calling IPCThreadState::self() during shutdown is dangerous, expect a crash.\n");
+ return NULL;
+ }
pthread_mutex_lock(&gTLSMutex);
if (!gHaveTLS) {
- if (pthread_key_create(&gTLS, threadDestructor) != 0) {
+ int key_create_value = pthread_key_create(&gTLS, threadDestructor);
+ if (key_create_value != 0) {
pthread_mutex_unlock(&gTLSMutex);
+ ALOGW("IPCThreadState::self() unable to create TLS key, expect a crash: %s\n",
+ strerror(key_create_value));
return NULL;
}
gHaveTLS = true;