summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-10-05 17:28:04 -0700
committerThe Android Automerger <android-build@android.com>2012-10-06 00:39:26 -0700
commit3e9f3b67b17afa4d064ac36a5bf5d9eeb1991b2f (patch)
treea074d7ececabcfbfe20a3353cd3ebc7442c45e98
parent0f326b9ab258529bec60dc3f1ea46922ae7d40ea (diff)
downloadframeworks_native-3e9f3b67b17afa4d064ac36a5bf5d9eeb1991b2f.zip
frameworks_native-3e9f3b67b17afa4d064ac36a5bf5d9eeb1991b2f.tar.gz
frameworks_native-3e9f3b67b17afa4d064ac36a5bf5d9eeb1991b2f.tar.bz2
ugly, temporary, workaroung for a problem where a binder thread spins forever
Bug: 7289992 Change-Id: I0c3d482a1af57e5f444be2ba7f2751ac3e954af2
-rw-r--r--libs/binder/IPCThreadState.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp
index 6e83faa..03c1082 100644
--- a/libs/binder/IPCThreadState.cpp
+++ b/libs/binder/IPCThreadState.cpp
@@ -482,6 +482,18 @@ void IPCThreadState::joinThreadPool(bool isMain)
if(result == TIMED_OUT && !isMain) {
break;
}
+
+ // HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK
+ // FIXME: we sometimes get unexplained EINVAL which causes this
+ // thread to spin forever. TEMPORARILY allow it to exit.
+ // We should probably assert on eng builds
+ if(result == -EINVAL && !isMain) {
+ ALOGE("**** THREAD %p (PID %d) ERROR (%d) LEAVING THE THREAD POOL\n",
+ (void*)pthread_self(), getpid(), result);
+ break;
+ }
+ // HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK
+
} while (result != -ECONNREFUSED && result != -EBADF);
LOG_THREADPOOL("**** THREAD %p (PID %d) IS LEAVING THE THREAD POOL err=%p\n",