impr: Set name of background service thread
This commit is contained in:
parent
510ed25509
commit
dfdd06b24c
@ -15,6 +15,7 @@
|
|||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <hex/api/task_manager.hpp>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
#include <wolv/io/file.hpp>
|
#include <wolv/io/file.hpp>
|
||||||
@ -1081,7 +1082,8 @@ namespace hex {
|
|||||||
|
|
||||||
impl::s_services->emplace_back(
|
impl::s_services->emplace_back(
|
||||||
unlocalizedName,
|
unlocalizedName,
|
||||||
std::jthread([callback = auto(callback)](const std::stop_token &stopToken){
|
std::jthread([=](const std::stop_token &stopToken){
|
||||||
|
TaskManager::setCurrentThreadName(Lang(unlocalizedName));
|
||||||
while (!stopToken.stop_requested()) {
|
while (!stopToken.stop_requested()) {
|
||||||
callback();
|
callback();
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user