From a9c0ac0c465e14a0b7593b5f22c13dc98480ca6d Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Fri, 21 Oct 2016 11:25:46 -0700 Subject: [PATCH] adb: turn darwin/windows builds back on, hopefully fix them. Bug: http://b/32292581 Change-Id: Ie5182165a122f7aed4a5728906f005cc7d54ddd1 --- adb/Android.mk | 4 +--- adb/sockets.c | 12 +++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/adb/Android.mk b/adb/Android.mk index 068f74488..721b48d5a 100644 --- a/adb/Android.mk +++ b/adb/Android.mk @@ -84,9 +84,7 @@ ifeq ($(USE_SYSDEPS_WIN32),) LOCAL_STATIC_LIBRARIES += libcutils endif -ifneq ($(HOST_OS),windows) - include $(BUILD_HOST_EXECUTABLE) -endif +include $(BUILD_HOST_EXECUTABLE) $(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE)) diff --git a/adb/sockets.c b/adb/sockets.c index 7b16a302b..da894c3f0 100644 --- a/adb/sockets.c +++ b/adb/sockets.c @@ -27,11 +27,13 @@ #define TRACE_TAG TRACE_SOCKETS #include "adb.h" -#if defined(__BIONIC__) -#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP PTHREAD_RECURSIVE_MUTEX_INITIALIZER -#endif - -static pthread_mutex_t socket_list_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +static pthread_mutex_t socket_list_lock; +static void __attribute__((constructor)) socket_list_lock_init(void) { + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&socket_list_lock, &attr); +} int sendfailmsg(int fd, const char *reason) {