Skip to content

Commit

Permalink
refactor: rename miniaudio thread (#5538)
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada authored Aug 10, 2024
1 parent 74d65a3 commit 2b45b2e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions src/controllers/sound/MiniaudioBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -193,6 +194,7 @@ MiniaudioBackend::MiniaudioBackend()
this->audioThread = std::make_unique<std::thread>([this] {
this->ioContext.run();
});
renameThread(*this->audioThread, "C2Miniaudio");
}

MiniaudioBackend::~MiniaudioBackend()
Expand Down
2 changes: 1 addition & 1 deletion src/util/RenameThread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 2b45b2e

Please sign in to comment.