summaryrefslogtreecommitdiff
path: root/src/mbgl/util/thread.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-02-29 18:23:24 +0100
committerKonstantin Käfer <mail@kkaefer.com>2016-04-04 16:20:04 -0700
commit65acf35dcfa3784de7e522926469083068599550 (patch)
treeaff3e7b1bb20d61bc29015de09d3e8e2f2e0ea06 /src/mbgl/util/thread.hpp
parent001d24dc338cd11ecfc5d5d1a37436b05be8c5f7 (diff)
downloadqtlocation-mapboxgl-65acf35dcfa3784de7e522926469083068599550.tar.gz
[core] fix various compilation issues
Diffstat (limited to 'src/mbgl/util/thread.hpp')
-rw-r--r--src/mbgl/util/thread.hpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mbgl/util/thread.hpp b/src/mbgl/util/thread.hpp
index 33ca5aba6b..dc388c922c 100644
--- a/src/mbgl/util/thread.hpp
+++ b/src/mbgl/util/thread.hpp
@@ -11,6 +11,8 @@
#include <mbgl/util/thread_context.hpp>
#include <mbgl/platform/platform.hpp>
+#include <pthread.h>
+
namespace mbgl {
namespace util {
@@ -93,11 +95,13 @@ Thread<Object>::Thread(const ThreadContext& context, Args&&... args) {
std::tuple<Args...> params = std::forward_as_tuple(::std::forward<Args>(args)...);
thread = std::thread([&] {
- #if defined( __APPLE__)
+#if defined(__APPLE__)
pthread_setname_np(context.name.c_str());
- #elif defined(__linux__)
+#elif defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 12)
pthread_setname_np(pthread_self(), context.name.c_str());
- #endif
+#endif
+#endif
if (context.priority == ThreadPriority::Low) {
platform::makeThreadLowPriority();