summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/default/sqlite_cache.cpp2
-rw-r--r--src/mbgl/util/thread.hpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/platform/default/sqlite_cache.cpp b/platform/default/sqlite_cache.cpp
index e618c960c4..dfb6290548 100644
--- a/platform/default/sqlite_cache.cpp
+++ b/platform/default/sqlite_cache.cpp
@@ -16,7 +16,7 @@ namespace mbgl {
using namespace mapbox::sqlite;
SQLiteCache::SQLiteCache(const std::string& path_)
- : thread(std::make_unique<util::Thread<Impl>>(util::ThreadContext{"SQLite Cache", util::ThreadType::Unknown, util::ThreadPriority::Low}, path_)) {
+ : thread(std::make_unique<util::Thread<Impl>>(util::ThreadContext{"SQLiteCache", util::ThreadType::Unknown, util::ThreadPriority::Low}, path_)) {
}
SQLiteCache::~SQLiteCache() = default;
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) {