adb: actually fix the windows build.

Bug: http://b/32292581
Change-Id: I714e1f47c2c2e89027989d485cb28891b905f931
This commit is contained in:
Josh Gao 2016-11-15 12:58:44 -08:00
parent a9c0ac0c46
commit 58eda35ace

View file

@ -20,13 +20,17 @@
#include <errno.h>
#include <string.h>
#include <ctype.h>
#include <pthread.h>
#include "sysdeps.h"
#define TRACE_TAG TRACE_SOCKETS
#include "adb.h"
#if defined(_WIN32)
#define pthread_mutex_lock(...) abort()
#define pthread_mutex_unlock(...) abort()
#else
#include <pthread.h>
static pthread_mutex_t socket_list_lock;
static void __attribute__((constructor)) socket_list_lock_init(void) {
pthread_mutexattr_t attr;
@ -34,6 +38,7 @@ static void __attribute__((constructor)) socket_list_lock_init(void) {
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&socket_list_lock, &attr);
}
#endif
int sendfailmsg(int fd, const char *reason)
{