3#ifndef MYTH_THREAD_POOL_H
4#define MYTH_THREAD_POOL_H
28 void DeletePoolThreads(
void);
31 static void StopAllPools(
void);
32 static void ShutdownAllPools(
void);
34 void start(QRunnable *runnable,
const QString& debugName,
int priority = 0);
35 bool tryStart(QRunnable *runnable,
const QString& debugName);
37 void startReserved(QRunnable *runnable,
const QString& debugName,
38 std::chrono::milliseconds waitForAvailMS = 0ms);
40 std::chrono::milliseconds expiryTimeout(
void)
const;
41 void setExpiryTimeout(std::chrono::milliseconds expiryTimeout);
43 int maxThreadCount(
void)
const;
44 void setMaxThreadCount(
int maxThreadCount);
46 int activeThreadCount(
void)
const;
48 void waitForDone(
void);
51 bool TryStartInternal(QRunnable *runnable,
const QString& debugName,
bool reserved);
54 void ReleaseThread(
void);
MThreadPool & operator=(const MThreadPool &)=delete
MThreadPool(const MThreadPool &)=delete
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
QThread::Priority priority(void) const