|
MythTV master
|
#include <libmythbase/mthreadpool.h>
Public Member Functions | |
| MThreadPool (const QString &name) | |
| ~MThreadPool () | |
| MThreadPool (const MThreadPool &)=delete | |
| MThreadPool & | operator= (const MThreadPool &)=delete |
| void | Stop (void) |
| void | DeletePoolThreads (void) |
| void | start (QRunnable *runnable, const QString &debugName, int priority=0) |
| bool | tryStart (QRunnable *runnable, const QString &debugName) |
| void | startReserved (QRunnable *runnable, const QString &debugName, std::chrono::milliseconds waitForAvailMS=0ms) |
| std::chrono::milliseconds | expiryTimeout (void) const |
| void | setExpiryTimeout (std::chrono::milliseconds expiryTimeout) |
| int | maxThreadCount (void) const |
| void | setMaxThreadCount (int maxThreadCount) |
| int | activeThreadCount (void) const |
| void | waitForDone (void) |
Static Public Member Functions | |
| static MThreadPool * | globalInstance (void) |
| static void | StopAllPools (void) |
| static void | ShutdownAllPools (void) |
Private Member Functions | |
| bool | TryStartInternal (QRunnable *runnable, const QString &debugName, bool reserved) |
| void | NotifyAvailable (MPoolThread *thread) |
| void | NotifyDone (MPoolThread *thread) |
| void | ReleaseThread (void) |
Private Attributes | |
| MThreadPoolPrivate * | m_priv {nullptr} |
Friends | |
| class | MPoolThread |
Definition at line 18 of file mthreadpool.h.
|
explicit |
Definition at line 237 of file mthreadpool.cpp.
Referenced by globalInstance().
| MThreadPool::~MThreadPool | ( | ) |
Definition at line 244 of file mthreadpool.cpp.
|
delete |
| int MThreadPool::activeThreadCount | ( | void | ) | const |
Definition at line 515 of file mthreadpool.cpp.
| void MThreadPool::DeletePoolThreads | ( | void | ) |
Definition at line 269 of file mthreadpool.cpp.
Referenced by ~MThreadPool().
| std::chrono::milliseconds MThreadPool::expiryTimeout | ( | void | ) | const |
Definition at line 491 of file mthreadpool.cpp.
Referenced by setExpiryTimeout().
|
static |
Definition at line 296 of file mthreadpool.cpp.
Referenced by MythSystemEventHandler::customEvent(), ThemeChooser::customEvent(), MythDownloadManager::downloadRemoteFile(), ImageHandler< DBFS >::HandleGetMetadata(), MainServer::HandleMoveFile(), MainServer::HandleQueryFreeSpace(), MainServer::HandleQueryFreeSpaceSummary(), ProgramInfoUpdater::insert(), MythScreenType::LoadInBackground(), TextSubtitleParser::LoadSubtitles(), MainServer::MainServer(), MythCommFlagPlayer::RebuildSeekTable(), BackendConnectionManager::ReconnectToBackend(), EditMetadataCommon::saveAll(), MusicData::scanMusic(), ProgramInfoCache::ScheduleLoad(), MythCoreContext::SendEvent(), MythCoreContext::SendMessage(), MConcurrent::RunFunctionTask::start(), DeleteThread::start(), TruncateThread::start(), Transcode::TranscodeFile(), MusicPlayer::updateVolatileMetadata(), and MythContext::~MythContext().
| int MThreadPool::maxThreadCount | ( | void | ) | const |
Definition at line 503 of file mthreadpool.cpp.
Referenced by HttpServer::HttpServer(), setMaxThreadCount(), and WebSocketServer::WebSocketServer().
|
private |
Definition at line 439 of file mthreadpool.cpp.
Referenced by MPoolThread::run().
|
private |
Definition at line 481 of file mthreadpool.cpp.
Referenced by MPoolThread::run().
|
delete |
|
private |
Definition at line 536 of file mthreadpool.cpp.
Referenced by MPoolThread::run().
| void MThreadPool::setExpiryTimeout | ( | std::chrono::milliseconds | expiryTimeout | ) |
Definition at line 497 of file mthreadpool.cpp.
| void MThreadPool::setMaxThreadCount | ( | int | maxThreadCount | ) |
Definition at line 509 of file mthreadpool.cpp.
Referenced by GuideGrid::GuideGrid(), HttpServer::HttpServer(), MainServer::MainServer(), and WebSocketServer::WebSocketServer().
|
static |
Definition at line 315 of file mthreadpool.cpp.
Referenced by MythCoreContextPrivate::~MythCoreContextPrivate().
| void MThreadPool::start | ( | QRunnable * | runnable, |
| const QString & | debugName, | ||
| int | priority = 0 |
||
| ) |
Definition at line 331 of file mthreadpool.cpp.
Referenced by ThemeChooser::customEvent(), MythDownloadManager::downloadRemoteFile(), GuideGrid::fillProgramRowInfos(), ImageHandler< DBFS >::HandleGetMetadata(), MainServer::HandleMoveFile(), TV::HandleSaveLastPlayPosEvent(), ProgramInfoUpdater::insert(), MythUIImage::Load(), MythScreenType::LoadInBackground(), MythCommFlagPlayer::RebuildSeekTable(), BackendConnectionManager::ReconnectToBackend(), EditMetadataCommon::saveAll(), MusicData::scanMusic(), ProgramInfoCache::ScheduleLoad(), MythCoreContext::SendEvent(), MythCoreContext::SendMessage(), MConcurrent::RunFunctionTask::start(), TruncateThread::start(), Transcode::TranscodeFile(), GuideGrid::updateChannels(), and MusicPlayer::updateVolatileMetadata().
| void MThreadPool::startReserved | ( | QRunnable * | runnable, |
| const QString & | debugName, | ||
| std::chrono::milliseconds | waitForAvailMS = 0ms |
||
| ) |
Definition at line 350 of file mthreadpool.cpp.
Referenced by MythSystemEventHandler::customEvent(), MainServer::HandleQueryFreeSpace(), MainServer::HandleQueryFreeSpaceSummary(), MainServer::MainServer(), HttpServer::newTcpConnection(), WebSocketServer::newTcpConnection(), MythSocketManager::readyRead(), MainServer::readyRead(), and DeleteThread::start().
| void MThreadPool::Stop | ( | void | ) |
Definition at line 256 of file mthreadpool.cpp.
Referenced by MainServer::Stop(), HttpServer::~HttpServer(), ~MThreadPool(), MythSocketManager::~MythSocketManager(), and WebSocketServer::~WebSocketServer().
|
static |
Definition at line 304 of file mthreadpool.cpp.
Referenced by MythCoreContextPrivate::~MythCoreContextPrivate().
| bool MThreadPool::tryStart | ( | QRunnable * | runnable, |
| const QString & | debugName | ||
| ) |
Definition at line 372 of file mthreadpool.cpp.
|
private |
Definition at line 378 of file mthreadpool.cpp.
Referenced by NotifyAvailable(), start(), startReserved(), and tryStart().
| void MThreadPool::waitForDone | ( | void | ) |
Definition at line 556 of file mthreadpool.cpp.
Referenced by DeletePoolThreads(), MythContext::~MythContext(), MythUIImage::~MythUIImage(), and TV::~TV().
|
friend |
Definition at line 20 of file mthreadpool.h.
Referenced by TryStartInternal().
|
private |
Definition at line 57 of file mthreadpool.h.
Referenced by activeThreadCount(), DeletePoolThreads(), expiryTimeout(), maxThreadCount(), NotifyAvailable(), NotifyDone(), ReleaseThread(), setExpiryTimeout(), setMaxThreadCount(), start(), startReserved(), Stop(), tryStart(), TryStartInternal(), waitForDone(), and ~MThreadPool().