refactor: rename miniaudio thread (#5538)

This commit is contained in:
pajlada 2024-08-10 15:01:06 +02:00 committed by GitHub
parent 74d65a345d
commit 2b45b2e0a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 1 deletions

View file

@ -61,6 +61,7 @@
- Dev: Refactored 7TV/BTTV definitions out of `TwitchIrcServer` into `Application`. (#5532)
- Dev: Refactored code that's responsible for deleting old update files. (#5535)
- Dev: Cleanly exit on shutdown. (#5537)
- Dev: Renamed miniaudio backend thread name. (#5538)
- Dev: Refactored a few `#define`s into `const(expr)` and cleaned includes. (#5527)
- Dev: Prepared for Qt 6.8 by addressing some deprecations. (#5529)

View file

@ -6,6 +6,7 @@
#include "singletons/Paths.hpp"
#include "singletons/Settings.hpp"
#include "singletons/WindowManager.hpp"
#include "util/RenameThread.hpp"
#include "widgets/Window.hpp"
#include <boost/asio/executor_work_guard.hpp>
@ -193,6 +194,7 @@ MiniaudioBackend::MiniaudioBackend()
this->audioThread = std::make_unique<std::thread>([this] {
this->ioContext.run();
});
renameThread(*this->audioThread, "C2Miniaudio");
}
MiniaudioBackend::~MiniaudioBackend()

View file

@ -10,7 +10,7 @@
namespace chatterino {
template <typename T>
void renameThread(T &&thread, const QString &threadName)
void renameThread(T &thread, const QString &threadName)
{
#ifdef Q_OS_LINUX
pthread_setname_np(thread.native_handle(), threadName.toLocal8Bit());