summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-10-29 11:54:43 +0200
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-10-29 11:54:43 +0200
commit978da4224e20c01efb01efe95bbfe51a45c6087d (patch)
tree822a736775d92c305ed40442068beda2898491c1 /src
parentd20bcb07957edc008d452db8ef5c91baa117bce6 (diff)
downloadqtlocation-mapboxgl-978da4224e20c01efb01efe95bbfe51a45c6087d.tar.gz
[core] Set names to threads on Linux
Makes debugging/profiling easier.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/util/thread.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mbgl/util/thread.hpp b/src/mbgl/util/thread.hpp
index b0d17bd52c..d7611254cc 100644
--- a/src/mbgl/util/thread.hpp
+++ b/src/mbgl/util/thread.hpp
@@ -93,8 +93,10 @@ Thread<Object>::Thread(const ThreadContext& context, Args&&... args) {
std::tuple<Args...> params = std::forward_as_tuple(::std::forward<Args>(args)...);
thread = std::thread([&] {
- #ifdef __APPLE__
+ #if defined( __APPLE__)
pthread_setname_np(context.name.c_str());
+ #elif defined(__linux__)
+ pthread_setname_np(pthread_self(), context.name.c_str());
#endif
if (context.priority == ThreadPriority::Low) {