add some thread names

This commit is contained in:
ConfiG 2024-01-28 19:03:21 +03:00
parent 416f2d588e
commit 5a59faa077
No known key found for this signature in database
GPG key ID: 44DA1983F524C11B
5 changed files with 11 additions and 0 deletions
loader/src

View file

@ -321,6 +321,8 @@ void Index::Impl::downloadIndex(std::string commitHash) {
.into(targetFile)
.then([this, targetFile, commitHash](auto) {
std::thread([=, this]() {
thread::setName("Index Update");
auto targetDir = dirs::getIndexDir() / "v0";
// delete old unzipped index
std::error_code ec;
@ -376,6 +378,7 @@ void Index::Impl::downloadIndex(std::string commitHash) {
void Index::Impl::checkForUpdates() {
if (m_isUpToDate) {
std::thread([this](){
thread::setName("Index Update");
this->updateFromLocalTree();
}).detach();
return;
@ -407,6 +410,7 @@ void Index::Impl::checkForUpdates() {
ghc::filesystem::exists(dirs::getIndexDir() / "v0" / "config.json")
) {
std::thread([this](){
thread::setName("Index Update");
this->updateFromLocalTree();
}).detach();
}

View file

@ -439,6 +439,7 @@ void Loader::Impl::loadModGraph(Mod* node, bool early) {
else {
auto nest = log::saveNest();
std::thread([=, this]() {
thread::setName("Mod Unzip");
log::loadNest(nest);
auto res = unzipFunction();
this->queueInMainThread([=, this]() {

View file

@ -112,6 +112,8 @@ CFDataRef msgPortCallback(CFMessagePortRef port, SInt32 messageID, CFDataRef dat
void geode::ipc::setup() {
std::thread([]() {
thread::setName("Geode Main IPC");
CFStringRef portName = CFStringCreateWithCString(NULL, IPC_PORT_NAME, kCFStringEncodingUTF8);
CFMessagePortRef localPort =

View file

@ -32,6 +32,8 @@ FileWatcher::~FileWatcher() {
}
void FileWatcher::watch() {
geode::utils::thread::setName("File Watcher");
HANDLE handle = (HANDLE)m_platformHandle;
while (WaitForSingleObject(handle, 10000) == WAIT_OBJECT_0) {
if (m_exiting) return;

View file

@ -252,6 +252,8 @@ SentAsyncWebRequest::Impl::Impl(SentAsyncWebRequest* self, AsyncWebRequest const
auto timeoutSeconds = req.m_impl->m_timeoutSeconds;
std::thread([this, timeoutSeconds]() {
thread::setName("Curl Request");
AWAIT_RESUME();
auto curl = curl_easy_init();