Move the pthread debugging flags to the right place.

Change-Id: Ie805bd837d1f72cdf1818e056c0baeb0857e4e84
This commit is contained in:
Elliott Hughes 2013-10-31 14:09:39 -07:00
parent 0360e3ab2d
commit 66759d6041
2 changed files with 5 additions and 15 deletions

View file

@ -886,6 +886,10 @@ LOCAL_MODULE := libc_bionic
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_SYSTEM_SHARED_LIBRARIES :=
# Set -DPTHREAD_DEBUG_ENABLED=true to enable support for pthread deadlock prediction.
# Since this code is experimental it is disabled by default.
LOCAL_CFLAGS += $(libc_common_cflags) -DPTHREAD_DEBUG_ENABLED=false
include $(BUILD_STATIC_LIBRARY)
@ -979,13 +983,7 @@ include $(BUILD_STATIC_LIBRARY)
# ========================================================
include $(CLEAR_VARS)
# pthread deadlock prediction:
# set -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=1 to enable support for
# pthread deadlock prediction.
# Since this code is experimental it is disabled by default.
# see libc/bionic/pthread_debug.c for details
LOCAL_CFLAGS := $(libc_common_cflags) -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0
LOCAL_CFLAGS := $(libc_common_cflags)
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)
LOCAL_C_INCLUDES := $(libc_common_c_includes)

View file

@ -553,13 +553,11 @@ int pthread_mutex_lock_impl(pthread_mutex_t *mutex)
int pthread_mutex_lock(pthread_mutex_t *mutex)
{
int err = pthread_mutex_lock_impl(mutex);
#ifdef PTHREAD_DEBUG
if (PTHREAD_DEBUG_ENABLED) {
if (!err) {
pthread_debug_mutex_lock_check(mutex);
}
}
#endif
return err;
}
@ -622,11 +620,9 @@ int pthread_mutex_unlock_impl(pthread_mutex_t *mutex)
int pthread_mutex_unlock(pthread_mutex_t *mutex)
{
#ifdef PTHREAD_DEBUG
if (PTHREAD_DEBUG_ENABLED) {
pthread_debug_mutex_unlock_check(mutex);
}
#endif
return pthread_mutex_unlock_impl(mutex);
}
@ -678,13 +674,11 @@ int pthread_mutex_trylock_impl(pthread_mutex_t *mutex)
int pthread_mutex_trylock(pthread_mutex_t *mutex)
{
int err = pthread_mutex_trylock_impl(mutex);
#ifdef PTHREAD_DEBUG
if (PTHREAD_DEBUG_ENABLED) {
if (!err) {
pthread_debug_mutex_lock_check(mutex);
}
}
#endif
return err;
}
@ -819,13 +813,11 @@ int pthread_mutex_lock_timeout_np_impl(pthread_mutex_t *mutex, unsigned msecs)
int pthread_mutex_lock_timeout_np(pthread_mutex_t *mutex, unsigned msecs)
{
int err = pthread_mutex_lock_timeout_np_impl(mutex, msecs);
#ifdef PTHREAD_DEBUG
if (PTHREAD_DEBUG_ENABLED) {
if (!err) {
pthread_debug_mutex_lock_check(mutex);
}
}
#endif
return err;
}