version 4.6.0
PIThreadNotifier::waitFor() new method PIThread::waitForFinish() now use condvar to exit as soon as possible
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user