* commit '8441e0312cf0215560b502a38284b1e918a31364': Move the pthread debugging flags to the right place.
This commit is contained in:
commit
f6bf2cd9b1
@ -887,6 +887,10 @@ LOCAL_MODULE := libc_bionic
|
|||||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
|
||||||
LOCAL_SYSTEM_SHARED_LIBRARIES :=
|
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)
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
@ -980,13 +984,7 @@ include $(BUILD_STATIC_LIBRARY)
|
|||||||
# ========================================================
|
# ========================================================
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
# pthread deadlock prediction:
|
LOCAL_CFLAGS := $(libc_common_cflags)
|
||||||
# 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_CONLYFLAGS := $(libc_common_conlyflags)
|
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
|
||||||
LOCAL_CPPFLAGS := $(libc_common_cppflags)
|
LOCAL_CPPFLAGS := $(libc_common_cppflags)
|
||||||
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
LOCAL_C_INCLUDES := $(libc_common_c_includes)
|
||||||
|
@ -553,13 +553,11 @@ int pthread_mutex_lock_impl(pthread_mutex_t *mutex)
|
|||||||
int pthread_mutex_lock(pthread_mutex_t *mutex)
|
int pthread_mutex_lock(pthread_mutex_t *mutex)
|
||||||
{
|
{
|
||||||
int err = pthread_mutex_lock_impl(mutex);
|
int err = pthread_mutex_lock_impl(mutex);
|
||||||
#ifdef PTHREAD_DEBUG
|
|
||||||
if (PTHREAD_DEBUG_ENABLED) {
|
if (PTHREAD_DEBUG_ENABLED) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
pthread_debug_mutex_lock_check(mutex);
|
pthread_debug_mutex_lock_check(mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -622,11 +620,9 @@ int pthread_mutex_unlock_impl(pthread_mutex_t *mutex)
|
|||||||
|
|
||||||
int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
||||||
{
|
{
|
||||||
#ifdef PTHREAD_DEBUG
|
|
||||||
if (PTHREAD_DEBUG_ENABLED) {
|
if (PTHREAD_DEBUG_ENABLED) {
|
||||||
pthread_debug_mutex_unlock_check(mutex);
|
pthread_debug_mutex_unlock_check(mutex);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return pthread_mutex_unlock_impl(mutex);
|
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 pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||||
{
|
{
|
||||||
int err = pthread_mutex_trylock_impl(mutex);
|
int err = pthread_mutex_trylock_impl(mutex);
|
||||||
#ifdef PTHREAD_DEBUG
|
|
||||||
if (PTHREAD_DEBUG_ENABLED) {
|
if (PTHREAD_DEBUG_ENABLED) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
pthread_debug_mutex_lock_check(mutex);
|
pthread_debug_mutex_lock_check(mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return err;
|
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 pthread_mutex_lock_timeout_np(pthread_mutex_t *mutex, unsigned msecs)
|
||||||
{
|
{
|
||||||
int err = pthread_mutex_lock_timeout_np_impl(mutex, msecs);
|
int err = pthread_mutex_lock_timeout_np_impl(mutex, msecs);
|
||||||
#ifdef PTHREAD_DEBUG
|
|
||||||
if (PTHREAD_DEBUG_ENABLED) {
|
if (PTHREAD_DEBUG_ENABLED) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
pthread_debug_mutex_lock_check(mutex);
|
pthread_debug_mutex_lock_check(mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user