MythTV  master
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MThreadPool Class Reference

#include <mthreadpool.h>

Collaboration diagram for MThreadPool:
Collaboration graph
[legend]

Public Member Functions

 MThreadPool (const QString &name)
 
 ~MThreadPool ()
 
void Stop (void)
 
void DeletePoolThreads (void)
 
void start (QRunnable *runnable, QString debugName, int priority=0)
 
bool tryStart (QRunnable *runnable, QString debugName)
 
void startReserved (QRunnable *runnable, QString debugName, int waitForAvailMS=0)
 
int expiryTimeout (void) const
 
void setExpiryTimeout (int expiryTimeout)
 
int maxThreadCount (void) const
 
void setMaxThreadCount (int maxThreadCount)
 
int activeThreadCount (void) const
 
void waitForDone (void)
 

Static Public Member Functions

static MThreadPoolglobalInstance (void)
 
static void StopAllPools (void)
 
static void ShutdownAllPools (void)
 

Private Member Functions

bool TryStartInternal (QRunnable *, QString, bool)
 
void NotifyAvailable (MPoolThread *)
 
void NotifyDone (MPoolThread *)
 
void ReleaseThread (void)
 

Private Attributes

MThreadPoolPrivatem_priv
 

Friends

class MPoolThread
 

Detailed Description

Definition at line 17 of file mthreadpool.h.

Constructor & Destructor Documentation

◆ MThreadPool()

MThreadPool::MThreadPool ( const QString &  name)
explicit

Definition at line 254 of file mthreadpool.cpp.

Referenced by globalInstance().

◆ ~MThreadPool()

MThreadPool::~MThreadPool ( )

Definition at line 261 of file mthreadpool.cpp.

Member Function Documentation

◆ Stop()

void MThreadPool::Stop ( void  )

◆ DeletePoolThreads()

void MThreadPool::DeletePoolThreads ( void  )

Definition at line 286 of file mthreadpool.cpp.

Referenced by ~MThreadPool().

◆ globalInstance()

MThreadPool * MThreadPool::globalInstance ( void  )
static

◆ StopAllPools()

void MThreadPool::StopAllPools ( void  )
static

Definition at line 322 of file mthreadpool.cpp.

Referenced by MythCoreContextPrivate::~MythCoreContextPrivate().

◆ ShutdownAllPools()

void MThreadPool::ShutdownAllPools ( void  )
static

Definition at line 333 of file mthreadpool.cpp.

Referenced by MythCoreContextPrivate::~MythCoreContextPrivate().

◆ start()

void MThreadPool::start ( QRunnable *  runnable,
QString  debugName,
int  priority = 0 
)

◆ tryStart()

bool MThreadPool::tryStart ( QRunnable *  runnable,
QString  debugName 
)

Definition at line 389 of file mthreadpool.cpp.

◆ startReserved()

void MThreadPool::startReserved ( QRunnable *  runnable,
QString  debugName,
int  waitForAvailMS = 0 
)

◆ expiryTimeout()

int MThreadPool::expiryTimeout ( void  ) const

Definition at line 509 of file mthreadpool.cpp.

Referenced by setExpiryTimeout().

◆ setExpiryTimeout()

void MThreadPool::setExpiryTimeout ( int  expiryTimeout)

Definition at line 515 of file mthreadpool.cpp.

◆ maxThreadCount()

int MThreadPool::maxThreadCount ( void  ) const

◆ setMaxThreadCount()

void MThreadPool::setMaxThreadCount ( int  maxThreadCount)

◆ activeThreadCount()

int MThreadPool::activeThreadCount ( void  ) const

Definition at line 533 of file mthreadpool.cpp.

◆ waitForDone()

void MThreadPool::waitForDone ( void  )

◆ TryStartInternal()

bool MThreadPool::TryStartInternal ( QRunnable *  runnable,
QString  debugName,
bool  reserved 
)
private

Definition at line 395 of file mthreadpool.cpp.

Referenced by NotifyAvailable(), start(), startReserved(), and tryStart().

◆ NotifyAvailable()

void MThreadPool::NotifyAvailable ( MPoolThread thread)
private

Definition at line 457 of file mthreadpool.cpp.

◆ NotifyDone()

void MThreadPool::NotifyDone ( MPoolThread thread)
private

Definition at line 499 of file mthreadpool.cpp.

◆ ReleaseThread()

void MThreadPool::ReleaseThread ( void  )
private

Definition at line 554 of file mthreadpool.cpp.

Friends And Related Function Documentation

◆ MPoolThread

friend class MPoolThread
friend

Definition at line 19 of file mthreadpool.h.

Referenced by TryStartInternal().

Member Data Documentation

◆ m_priv

MThreadPoolPrivate* MThreadPool::m_priv
private

The documentation for this class was generated from the following files: