summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2012-03-13 11:17:13 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-03-13 11:17:13 -0700
commitd4d8b877879fa6b82dfbdcfa858ebf136cee1df6 (patch)
tree4d377d16a733952af89166989d5c10a169764c6d
parentc4c9881e5d22432f3f1a30eeec5aa109dfc08a7d (diff)
parent4ae722af0d45b71a29407fe9939117b22c6dd090 (diff)
Merge "Mac OS only gained pthread_setname_np in 10.6..." into dalvik-dev
-rw-r--r--src/utils.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/utils.cc b/src/utils.cc
index cf3e6c3223..4895fe5a5b 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -38,6 +38,10 @@
#include <sys/prctl.h>
#endif
+#if defined(__APPLE__)
+#include "AvailabilityMacros.h"
+#endif
+
#if defined(__linux__)
#include <linux/unistd.h>
#endif
@@ -714,7 +718,7 @@ void SetThreadName(const char* threadName) {
if (errno != 0) {
PLOG(WARNING) << "Unable to set the name of current thread to '" << buf << "'";
}
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
pthread_setname_np(threadName);
#elif defined(HAVE_PRCTL)
prctl(PR_SET_NAME, (unsigned long) s, 0, 0, 0);