mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Rename the BasicPubSubManager thread
This commit is contained in:
parent
934e518e18
commit
06cb7d5259
3 changed files with 23 additions and 0 deletions
|
@ -486,6 +486,7 @@ set(SOURCE_FILES
|
|||
util/RapidjsonHelpers.hpp
|
||||
util/RatelimitBucket.cpp
|
||||
util/RatelimitBucket.hpp
|
||||
util/RenameThread.hpp
|
||||
util/SampleData.cpp
|
||||
util/SampleData.hpp
|
||||
util/SharedPtrElementLess.hpp
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "providers/twitch/PubSubHelpers.hpp"
|
||||
#include "util/DebugCount.hpp"
|
||||
#include "util/ExponentialBackoff.hpp"
|
||||
#include "util/RenameThread.hpp"
|
||||
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
#include <QJsonObject>
|
||||
|
@ -118,6 +119,8 @@ public:
|
|||
this->mainThread_.reset(new std::thread([this] {
|
||||
runThread();
|
||||
}));
|
||||
|
||||
renameThread(*this->mainThread_.get(), "BPSM");
|
||||
}
|
||||
|
||||
void stop()
|
||||
|
|
19
src/util/RenameThread.hpp
Normal file
19
src/util/RenameThread.hpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
template <typename T>
|
||||
void renameThread(T &&thread, const char *threadName)
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
pthread_setname_np(thread.native_handle(), threadName);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
Loading…
Reference in a new issue