Skip to content

Commit

Permalink
Number each thread sequentially up to maxThreads()
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarta committed Oct 7, 2021
1 parent 3c159a9 commit 9d43250
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mythtv/libs/libmythbase/http/mythhttpserver.cpp
Expand Up @@ -253,7 +253,8 @@ void MythHTTPServer::ProcessTCPQueue()
auto Socket = m_connectionQueue.dequeue();
auto * server = qobject_cast<PrivTcpServer*>(QObject::sender());
auto ssl = server ? server->GetServerType() == kSSLServer : false;
auto name = QString("HTTP%1%2").arg(ssl ? "S" : "").arg(ThreadCount());
m_threadNum = m_threadNum % MaxThreads();
auto name = QString("HTTP%1%2").arg(ssl ? "S" : "").arg(m_threadNum++);
auto * newthread = new MythHTTPThread(this, m_config, name, Socket, ssl);
AddThread(newthread);
connect(newthread->qthread(), &QThread::finished, this, &MythHTTPThreadPool::ThreadFinished);
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythbase/http/mythhttpserver.h
Expand Up @@ -77,6 +77,7 @@ class MythHTTPServer : public MythHTTPThreadPool
int m_masterSSLPort { 0 };
QString m_masterIPAddress { };
QQueue<qintptr> m_connectionQueue;
int m_threadNum { 0 };
};

#endif

0 comments on commit 9d43250

Please sign in to comment.