diff options
| author | 2012-03-13 11:17:13 -0700 | |
|---|---|---|
| committer | 2012-03-13 11:17:13 -0700 | |
| commit | d4d8b877879fa6b82dfbdcfa858ebf136cee1df6 (patch) | |
| tree | 4d377d16a733952af89166989d5c10a169764c6d | |
| parent | c4c9881e5d22432f3f1a30eeec5aa109dfc08a7d (diff) | |
| parent | 4ae722af0d45b71a29407fe9939117b22c6dd090 (diff) | |
Merge "Mac OS only gained pthread_setname_np in 10.6..." into dalvik-dev
| -rw-r--r-- | src/utils.cc | 6 |
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); |