66 if (isRunning()) QThread::setPriority (
mPriority);
87 LOGWARNING <<
"setTimerInterval(...) called while thread is running";
128 if (not isRunning()) msleep(1);
183 first.setSingleShot(
true);
222 #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) 223 pthread_setname_np (pthread_self(), threadname.toStdString().c_str());
224 LOGMESSAGE << threadname.toStdString().c_str() <<
"thread started:" 228 LOGMESSAGE <<
"Thread names are not avialable on this platform";
247 #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) 248 unsigned int id = (
unsigned int)pthread_self();
250 pthread_getname_np(pthread_self(),buffer,100);
251 s +=
"id = " + QString::number(
id) +
" (" + QString(buffer) +
")";
253 s = QString(
"(Thread name not available on this platform)");
QThread::Priority mPriority
Assigned priority of the thread.
QString mThreadName
Assigned thread name.
Universal base class for threaded modules.
QString getThreadName() const
Helper function for debugging: Get the current thread id and time.
void setModuleName(const QString &name)
Specify the name of the class-specific module.
bool start()
Start thread and move base class to the new thread.
virtual void finallyCalledWorker()
Virtual worker function called when the thread stops.
void setTimerInterval(const int msec, const int firstMsec)
Set timer interval in milliseconds.
virtual void initiallyCalledWorker()
Virtual worker function called when the thread is starting.
void setPriority(const QThread::Priority p)
Specify the priority of the thread.
int mFirstInterval
Assigned periodic waiting time in milliseconds.
virtual void timeout()
Private timeout slot called by the worker.
virtual void run() override final
Private thread worker function, starting execution loop.
void setThreadName(const QString name)
Set thread name.
ThreadBase * pThreadBase
Pointer back to the instance of the ThreadBase.
bool stop()
Send a request to the thread for termination.
void stopTimer()
Helper signal for stopping the temporarily existing timer.
void setCurrentThreadName(QString threadname)
Helper function for debugging: set the current thread name.
bool mSuspended
Flag indicating suspended state.
ThreadWorker(ThreadBase *threadbase)
Constructor.
void startTimer()
Helper signal for starting the temporarily existing timer.