diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-10-29 11:54:43 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-10-29 11:54:43 +0200 |
commit | 978da4224e20c01efb01efe95bbfe51a45c6087d (patch) | |
tree | 822a736775d92c305ed40442068beda2898491c1 /src/mbgl/util/thread.hpp | |
parent | d20bcb07957edc008d452db8ef5c91baa117bce6 (diff) | |
download | qtlocation-mapboxgl-978da4224e20c01efb01efe95bbfe51a45c6087d.tar.gz |
[core] Set names to threads on Linux
Makes debugging/profiling easier.
Diffstat (limited to 'src/mbgl/util/thread.hpp')
-rw-r--r-- | src/mbgl/util/thread.hpp | 4 |
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) { |