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 248 of file mthreadpool.cpp.
Referenced by globalInstance().
MThreadPool::~MThreadPool | ( | ) |
Definition at line 255 of file mthreadpool.cpp.
|
delete |
|
delete |
void MThreadPool::Stop | ( | void | ) |
Definition at line 267 of file mthreadpool.cpp.
Referenced by MainServer::Stop(), HttpServer::~HttpServer(), ~MThreadPool(), MythSocketManager::~MythSocketManager(), and WebSocketServer::~WebSocketServer().
void MThreadPool::DeletePoolThreads | ( | void | ) |
Definition at line 280 of file mthreadpool.cpp.
Referenced by ~MThreadPool().
|
static |
Definition at line 307 of file mthreadpool.cpp.
Referenced by ThemeChooser::customEvent(), MythSystemEventHandler::customEvent(), MythDownloadManager::downloadRemoteFile(), ImageHandler< ImageDbSg >::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(), HTTPLiveStream::StartStream(), Transcode::TranscodeFile(), MusicPlayer::updateVolatileMetadata(), and MythContext::~MythContext().
|
static |
Definition at line 315 of file mthreadpool.cpp.
Referenced by MythCoreContextPrivate::~MythCoreContextPrivate().
|
static |
Definition at line 326 of file mthreadpool.cpp.
Referenced by MythCoreContextPrivate::~MythCoreContextPrivate().
void MThreadPool::start | ( | QRunnable * | runnable, |
const QString & | debugName, | ||
int | priority = 0 |
||
) |
Definition at line 342 of file mthreadpool.cpp.
Referenced by ThemeChooser::customEvent(), MythDownloadManager::downloadRemoteFile(), GuideGrid::fillProgramRowInfos(), ImageHandler< ImageDbSg >::HandleGetMetadata(), MainServer::HandleMoveFile(), 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().
bool MThreadPool::tryStart | ( | QRunnable * | runnable, |
const QString & | debugName | ||
) |
Definition at line 383 of file mthreadpool.cpp.
void MThreadPool::startReserved | ( | QRunnable * | runnable, |
const QString & | debugName, | ||
std::chrono::milliseconds | waitForAvailMS = 0ms |
||
) |
Definition at line 361 of file mthreadpool.cpp.
Referenced by MythSystemEventHandler::customEvent(), MainServer::HandleQueryFreeSpace(), MainServer::HandleQueryFreeSpaceSummary(), MainServer::MainServer(), WebSocketServer::newTcpConnection(), HttpServer::newTcpConnection(), MythSocketManager::readyRead(), MainServer::readyRead(), DeleteThread::start(), and HTTPLiveStream::StartStream().
std::chrono::milliseconds MThreadPool::expiryTimeout | ( | void | ) | const |
Definition at line 500 of file mthreadpool.cpp.
Referenced by setExpiryTimeout().
void MThreadPool::setExpiryTimeout | ( | std::chrono::milliseconds | expiryTimeout | ) |
Definition at line 506 of file mthreadpool.cpp.
int MThreadPool::maxThreadCount | ( | void | ) | const |
Definition at line 512 of file mthreadpool.cpp.
Referenced by HttpServer::HttpServer(), setMaxThreadCount(), and WebSocketServer::WebSocketServer().
void MThreadPool::setMaxThreadCount | ( | int | maxThreadCount | ) |
Definition at line 518 of file mthreadpool.cpp.
Referenced by GuideGrid::GuideGrid(), HttpServer::HttpServer(), MainServer::MainServer(), and WebSocketServer::WebSocketServer().
int MThreadPool::activeThreadCount | ( | void | ) | const |
Definition at line 524 of file mthreadpool.cpp.
void MThreadPool::waitForDone | ( | void | ) |
Definition at line 565 of file mthreadpool.cpp.
Referenced by DeletePoolThreads(), MythContext::~MythContext(), and MythUIImage::~MythUIImage().
|
private |
Definition at line 389 of file mthreadpool.cpp.
Referenced by NotifyAvailable(), start(), startReserved(), and tryStart().
|
private |
Definition at line 448 of file mthreadpool.cpp.
Referenced by MPoolThread::run().
|
private |
Definition at line 490 of file mthreadpool.cpp.
Referenced by MPoolThread::run().
|
private |
Definition at line 545 of file mthreadpool.cpp.
Referenced by MPoolThread::run().
|
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().