diff options
author | Fredrik Karlsson <bjorn.fredrik.karlsson@gmail.com> | 2019-07-30 21:49:51 +0300 |
---|---|---|
committer | Fredrik Karlsson <bjorn.fredrik.karlsson@gmail.com> | 2019-07-30 21:49:51 +0300 |
commit | 943937debdd3b731322aab05fbce4405d455edb3 (patch) | |
tree | 45e1b23f61b03eb6c6dd4ec3d2dc5f59ebe6caaf | |
parent | 75abcd0b4a5e3161082d3c5d0fe306d7719cb229 (diff) | |
download | qtlocation-mapboxgl-upstream/fred/thread-fix.tar.gz |
temp thread workaroundupstream/fred/thread-fix
-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() { |