From d3adefc646c15be3f6ba73b6afaaa610f4538246 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 12 Sep 2014 10:30:07 -0700 Subject: Move wilhelm over to pthread_gettid_np. Bug: 17476168 Change-Id: Ib8f00d0934deaefbb5bc07f4f0ab6dc7a4e30988 --- src/Android.mk | 3 --- src/locks.c | 7 +++---- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Android.mk b/src/Android.mk index 3b482ba..4dcd1ab 100644 --- a/src/Android.mk +++ b/src/Android.mk @@ -165,9 +165,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 -// 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, -- cgit v1.2.3