summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-09-12 20:08:39 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-12 20:08:39 +0000
commit722ec793f387e09e88790680bfe7c70323e4211a (patch)
treea058e8688e3891b0383a2656221c69b386d17bbe
parent150d47ebfd54c3a6377efbd6e79cbc030ffc9277 (diff)
parent5a55e234fc79b0da96a2e158d90cd5ba2f12d9ef (diff)
downloadandroid_frameworks_wilhelm-722ec793f387e09e88790680bfe7c70323e4211a.tar.gz
android_frameworks_wilhelm-722ec793f387e09e88790680bfe7c70323e4211a.tar.bz2
android_frameworks_wilhelm-722ec793f387e09e88790680bfe7c70323e4211a.zip
am 5a55e234: Merge "Move wilhelm over to pthread_gettid_np."
* commit '5a55e234fc79b0da96a2e158d90cd5ba2f12d9ef': Move wilhelm over to pthread_gettid_np.
-rw-r--r--src/Android.mk3
-rw-r--r--src/locks.c7
2 files changed, 3 insertions, 7 deletions
diff --git a/src/Android.mk b/src/Android.mk
index 82fae28..195aaf8 100644
--- a/src/Android.mk
+++ b/src/Android.mk
@@ -169,9 +169,6 @@ LOCAL_C_INCLUDES:= \
frameworks/native/include/media/openmax \
$(call include-path-for, audio-effects)
-# __pthread_gettid
-LOCAL_C_INCLUDES += bionic/libc/private
-
LOCAL_CFLAGS += -x c++ -Wno-multichar -Wno-invalid-offsetof
LOCAL_STATIC_LIBRARIES += \
diff --git a/src/locks.c b/src/locks.c
index 776eef7..f093365 100644
--- a/src/locks.c
+++ b/src/locks.c
@@ -15,10 +15,9 @@
*/
#include "sles_allinclusive.h"
-#include <bionic_pthread.h>
-// Use this macro to validate a pthread_t before passing it into __pthread_gettid.
+// Use this macro to validate a pthread_t before passing it into pthread_gettid_np.
// One of the common reasons for deadlock is trying to lock a mutex for an object
// which has been destroyed (which does memset to 0x00 or 0x55 as the final step).
// To avoid crashing with a SIGSEGV right before we're about to log a deadlock warning,
@@ -83,7 +82,7 @@ void object_lock_exclusive_(IObject *thiz, const char *file, int line)
pthread_t me = pthread_self();
pthread_t owner = thiz->mOwner;
// unlikely, but this could result in a memory fault if owner is corrupt
- pid_t ownerTid = LIKELY_VALID(owner) ? __pthread_gettid(owner) : -1;
+ pid_t ownerTid = LIKELY_VALID(owner) ? pthread_gettid_np(owner) : -1;
SL_LOGW("%s:%d: pthread %p (tid %d) sees object %p was locked by pthread %p"
" (tid %d) at %s:%d\n", file, line, *(void **)&me, gettid(), thiz,
*(void **)&owner, ownerTid, thiz->mFile, thiz->mLine);
@@ -102,7 +101,7 @@ forward_progress:
if (0 != memcmp(&zero, &thiz->mOwner, sizeof(pthread_t))) {
pthread_t me = pthread_self();
pthread_t owner = thiz->mOwner;
- pid_t ownerTid = LIKELY_VALID(owner) ? __pthread_gettid(owner) : -1;
+ pid_t ownerTid = LIKELY_VALID(owner) ? pthread_gettid_np(owner) : -1;
if (pthread_equal(pthread_self(), owner)) {
SL_LOGE("%s:%d: pthread %p (tid %d) sees object %p was recursively locked by pthread"
" %p (tid %d) at %s:%d\n", file, line, *(void **)&me, gettid(), thiz,