summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Albert2015-03-23 18:12:59 -0500
committerGerrit Code Review2015-03-23 18:13:00 -0500
commit89996c4b74c438bd426710ff52139893aa39514c (patch)
tree51a4096f704ddf24593eb22f38cb4ba072dd0ed6
parentddccd24f446797cfc3455f309d55c54183b64b53 (diff)
parente308104390031da79237a1d00d387276f7edc003 (diff)
downloadplatform-system-core-89996c4b74c438bd426710ff52139893aa39514c.tar.gz
platform-system-core-89996c4b74c438bd426710ff52139893aa39514c.tar.xz
platform-system-core-89996c4b74c438bd426710ff52139893aa39514c.zip
Merge "Undo mac fix to fix windows, fix mac differently."
-rw-r--r--libcutils/Android.mk2
-rw-r--r--libcutils/threads.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/libcutils/Android.mk b/libcutils/Android.mk
index 876b89d32..2c5e351a2 100644
--- a/libcutils/Android.mk
+++ b/libcutils/Android.mk
@@ -68,7 +68,7 @@ endif
68# ======================================================== 68# ========================================================
69LOCAL_MODULE := libcutils 69LOCAL_MODULE := libcutils
70LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c 70LOCAL_SRC_FILES := $(commonSources) $(commonHostSources) dlmalloc_stubs.c
71LOCAL_STATIC_LIBRARIES := liblog libbase 71LOCAL_STATIC_LIBRARIES := liblog
72ifneq ($(HOST_OS),windows) 72ifneq ($(HOST_OS),windows)
73LOCAL_CFLAGS += -Werror 73LOCAL_CFLAGS += -Werror
74endif 74endif
diff --git a/libcutils/threads.c b/libcutils/threads.c
index cafeff73f..d90161951 100644
--- a/libcutils/threads.c
+++ b/libcutils/threads.c
@@ -23,7 +23,6 @@
23#include "AvailabilityMacros.h" // For MAC_OS_X_VERSION_MAX_ALLOWED 23#include "AvailabilityMacros.h" // For MAC_OS_X_VERSION_MAX_ALLOWED
24#include <sys/syscall.h> 24#include <sys/syscall.h>
25#include <sys/time.h> 25#include <sys/time.h>
26#include "base/logging.h"
27#elif defined(__linux__) && !defined(__ANDROID__) 26#elif defined(__linux__) && !defined(__ANDROID__)
28#include <syscall.h> 27#include <syscall.h>
29#include <unistd.h> 28#include <unistd.h>
@@ -61,7 +60,10 @@ extern void thread_store_set( thread_store_t* store,
61pid_t gettid() { 60pid_t gettid() {
62#if defined(__APPLE__) 61#if defined(__APPLE__)
63 uint64_t owner; 62 uint64_t owner;
64 CHECK_PTHREAD_CALL(pthread_threadid_np, (NULL, &owner), __FUNCTION__); 63 int rc = pthread_threadid_np(NULL, &owner);
64 if (rc != 0) {
65 abort();
66 }
65 return owner; 67 return owner;
66#elif defined(__linux__) 68#elif defined(__linux__)
67 return syscall(__NR_gettid); 69 return syscall(__NR_gettid);