refactor: show thread names in GDB for better debugging (#848)

This commit is contained in:
Murat Seker 2020-06-28 23:43:45 +02:00 committed by GitHub
parent a68ed7d44f
commit 485beab4f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 0 deletions

View File

@ -74,6 +74,7 @@ bool HyperionIManager::startInstance(const quint8& inst, const bool& block)
if(!_runningInstances.contains(inst) && !_startQueue.contains(inst))
{
QThread* hyperionThread = new QThread();
hyperionThread->setObjectName("HyperionIManagerThread");
Hyperion* hyperion = new Hyperion(inst);
hyperion->moveToThread(hyperionThread);
// setup thread management

View File

@ -47,6 +47,7 @@ void LedDeviceWrapper::createLedDevice(const QJsonObject& config)
// create thread and device
QThread* thread = new QThread(this);
thread->setObjectName("LedDeviceWrapperThread");
_ledDevice = LedDeviceFactory::construct(config);
_ledDevice->moveToThread(thread);
// setup thread management

View File

@ -9,6 +9,8 @@ AmlogicWrapper::AmlogicWrapper(const unsigned grabWidth, const unsigned grabHeig
_thread(this),
_grabber(grabWidth, grabHeight)
{
_thread.setObjectName("AmlogicWrapperThread");
// Connect capturing to the timeout signal of the timer
connect(&_thread, SIGNAL (started()), this, SLOT(capture()));
}

View File

@ -233,6 +233,7 @@ void HyperionDaemon::startNetworkServices()
// Create FlatBuffer server in thread
_flatBufferServer = new FlatBufferServer(getSetting(settings::FLATBUFSERVER));
QThread *fbThread = new QThread(this);
fbThread->setObjectName("FlatBufferServerThread");
_flatBufferServer->moveToThread(fbThread);
connect(fbThread, &QThread::started, _flatBufferServer, &FlatBufferServer::initServer);
connect(this, &HyperionDaemon::settingsChanged, _flatBufferServer, &FlatBufferServer::handleSettingsUpdate);
@ -241,6 +242,7 @@ void HyperionDaemon::startNetworkServices()
// Create Proto server in thread
_protoServer = new ProtoServer(getSetting(settings::PROTOSERVER));
QThread *pThread = new QThread(this);
pThread->setObjectName("ProtoServerThread");
_protoServer->moveToThread(pThread);
connect(pThread, &QThread::started, _protoServer, &ProtoServer::initServer);
connect(this, &HyperionDaemon::settingsChanged, _protoServer, &ProtoServer::handleSettingsUpdate);
@ -249,6 +251,7 @@ void HyperionDaemon::startNetworkServices()
// Create Webserver in thread
_webserver = new WebServer(getSetting(settings::WEBSERVER), false);
QThread *wsThread = new QThread(this);
wsThread->setObjectName("WebServerThread");
_webserver->moveToThread(wsThread);
connect(wsThread, &QThread::started, _webserver, &WebServer::initServer);
connect(this, &HyperionDaemon::settingsChanged, _webserver, &WebServer::handleSettingsUpdate);
@ -257,6 +260,7 @@ void HyperionDaemon::startNetworkServices()
// Create SSL Webserver in thread
_sslWebserver = new WebServer(getSetting(settings::WEBSERVER), true);
QThread *sslWsThread = new QThread(this);
sslWsThread->setObjectName("SSLWebServerThread");
_sslWebserver->moveToThread(sslWsThread);
connect(sslWsThread, &QThread::started, _sslWebserver, &WebServer::initServer);
connect(this, &HyperionDaemon::settingsChanged, _sslWebserver, &WebServer::handleSettingsUpdate);
@ -265,6 +269,7 @@ void HyperionDaemon::startNetworkServices()
// Create SSDP server in thread
_ssdp = new SSDPHandler(_webserver, getSetting(settings::FLATBUFSERVER).object()["port"].toInt(), getSetting(settings::JSONSERVER).object()["port"].toInt(), getSetting(settings::GENERAL).object()["name"].toString());
QThread *ssdpThread = new QThread(this);
ssdpThread->setObjectName("SSDPThread");
_ssdp->moveToThread(ssdpThread);
connect(ssdpThread, &QThread::started, _ssdp, &SSDPHandler::initServer);
connect(_webserver, &WebServer::stateChange, _ssdp, &SSDPHandler::handleWebServerStateChange);