53 explicit MThread(
const QString &objectName);
58 explicit MThread(
const QString &objectName, QRunnable *runnable);
72 QThread *qthread(
void);
74 void setObjectName(
const QString &name);
75 QString objectName(
void)
const;
77 void setPriority(QThread::Priority priority);
78 QThread::Priority priority(
void)
const;
80 bool isFinished(
void)
const;
83 void setStackSize(
uint stackSize);
84 uint stackSize(
void)
const;
87 void exit(
int retcode = 0);
89 void start(QThread::Priority
p = QThread::InheritPriority);
102 static void ThreadSetup(
const QString& name);
105 static void ThreadCleanup(
void);
110 bool wait(std::chrono::milliseconds time = std::chrono::milliseconds::max());
115 static void Cleanup(
void);
116 static void GetAllThreadNames(QStringList &list);
117 static void GetAllRunningThreadNames(QStringList &list);
125 virtual void run(
void);
129 static void setTerminationEnabled(
bool enabled =
true);
132 QRunnable *m_runnable {
nullptr};
133 bool m_prologExecuted {
true};
134 bool m_epilogExecuted {
true};
This is a wrapper around QThread that does several additional things.
MThread(const MThread &)=delete
MThread & operator=(const MThread &)=delete
bool MBASE_PUBLIC is_current_thread(MThread *thread)
Use this to determine if you are in the named thread.
static bool isRunning(const char *program)
Returns true if a program containing the specified string is running on this machine.
void run(const QString &name, Class *object, void(Class::*fn)())