core: set thread name for tracy (#4076)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifdef MLN_TRACY_ENABLE
|
||||
|
||||
#include <tracy/Tracy.hpp>
|
||||
@@ -128,3 +130,7 @@ constexpr const char* tracyConstMemoryLabel = "Constant Buffer Memory";
|
||||
#define MLN_TRACE_ZONE(label) ((void)0)
|
||||
|
||||
#endif // MLN_TRACY_ENABLE
|
||||
|
||||
namespace mbgl::instrumentation {
|
||||
void setThreadName(const std::string& name);
|
||||
};
|
||||
|
||||
@@ -7,12 +7,11 @@
|
||||
#include <mbgl/util/platform.hpp>
|
||||
#include <mbgl/util/run_loop.hpp>
|
||||
#include <mbgl/util/util.hpp>
|
||||
#include <mbgl/util/instrumentation.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <future>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
@@ -51,6 +50,8 @@ public:
|
||||
runningPromise = std::move(running_),
|
||||
prioritySetter = std::move(prioritySetter_)]() mutable {
|
||||
platform::setCurrentThreadName(name);
|
||||
instrumentation::setThreadName(name);
|
||||
|
||||
if (prioritySetter) prioritySetter();
|
||||
platform::attachThread();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user