diff options
Diffstat (limited to 'platform/default/src/mbgl/util/thread.cpp')
-rw-r--r-- | platform/default/src/mbgl/util/thread.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/default/src/mbgl/util/thread.cpp b/platform/default/src/mbgl/util/thread.cpp index 28772d9561..48950d48fc 100644 --- a/platform/default/src/mbgl/util/thread.cpp +++ b/platform/default/src/mbgl/util/thread.cpp @@ -18,20 +18,26 @@ std::string getCurrentThreadName() { } void setCurrentThreadName(const std::string& name) { +#ifdef __APPLE__ +#else if (name.size() > 15) { // Linux hard limit (see manpages). pthread_setname_np(pthread_self(), name.substr(0, 15).c_str()); } else { pthread_setname_np(pthread_self(), name.c_str()); } +#endif } void makeThreadLowPriority() { struct sched_param param; param.sched_priority = 0; +#ifdef __APPLE__ +#else if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) { Log::Warning(Event::General, "Couldn't set thread scheduling policy"); } +#endif } void attachThread() { |