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);
130 static void usleep(std::chrono::microseconds time);
131 template<
typename R,
typename P>
132 static typename std::enable_if_t<std::chrono::treat_as_floating_point<R>::value,
void>
133 usleep(std::chrono::duration<R,P> time) {
usleep(duration_cast<std::chrono::microseconds>(time)); };
136 QRunnable *m_runnable {
nullptr};
137 bool m_prologExecuted {
true};
138 bool m_epilogExecuted {
true};
141 #endif // MYTH_THREAD_H