version 4.6.0

PIThreadNotifier::waitFor() new method
PIThread::waitForFinish() now use condvar to exit as soon as possible
This commit is contained in:
2025-01-15 17:57:16 +03:00
parent 60d2a83df5
commit 0dd47f50a0
6 changed files with 50 additions and 22 deletions

View File

@@ -26,6 +26,7 @@
#ifndef PITHREAD_H
#define PITHREAD_H
#include "piconditionvar.h"
#include "piinit.h"
#include "pimutex.h"
#include "piobject.h"
@@ -286,10 +287,11 @@ protected:
PISystemTime delay_;
llong tid_ = -1;
void * data_ = nullptr;
mutable PIMutex thread_mutex;
mutable PIMutex thread_mutex, state_mutex;
PITimeMeasurer tmf_, tms_, tmr_;
PIThread::Priority priority_ = piNormal;
ThreadFunc ret_func = nullptr;
PIConditionVariable state_var;
PRIVATE_DECLARATION(PIP_EXPORT)
private:
@@ -297,6 +299,7 @@ private:
void _beginThread();
void _runThread();
void _endThread();
bool _waitForFinish(PISystemTime max_tm);
PIByteArray createThreadName(int size = 16) const;
void setThreadName();