diff options
author | Andreas Gampe <agampe@google.com> | 2016-02-01 22:23:33 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-02-01 22:23:33 +0000 |
commit | 2be113a2489e7d56b21f8ec340198959348012b3 (patch) | |
tree | 21301b3c7b771a0c7eec5cad12824349dbb3fb3c | |
parent | ac4728f8ba54e5f25466efeaf65a1dbda179ca97 (diff) | |
parent | f31a3eb3290c4154bd04113c8bb859a499f288b6 (diff) | |
download | native-2be113a2489e7d56b21f8ec340198959348012b3.tar.gz |
Merge "Binder: Add log output in IPCThreadState::self()"
-rw-r--r-- | libs/binder/IPCThreadState.cpp | 10 |
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; |