Guitarix
Loading...
Searching...
No Matches
ParallelThread Class Reference

#include <ParallelThread.h>

Inheritance diagram for ParallelThread:
ProcessPtr

Public Member Functions

 ParallelThread ()
 
 ~ParallelThread ()
 
void start () noexcept
 
bool isRunning () const noexcept
 
void setThreadName (std::string name) noexcept
 
void setPriority (int32_t rt_prio, int32_t rt_policy) noexcept
 
void setTimeOut (uint32_t timeout) noexcept
 
bool getProcess () noexcept
 
void runProcess () noexcept
 
void processWait () noexcept
 
void stop () noexcept
 
- Public Member Functions inherited from ProcessPtr
 ProcessPtr ()
 
template<class C , void(C::*)() Function>
void set (C *instance)
 
template<uint32_t s, class C , void(C::*)() Function>
void set (C *instance)
 
void setProcessor (uint32_t i_)
 
void process () const
 
void dummyFunc ()
 

Private Member Functions

void init () noexcept
 
void run () noexcept
 
bool getState () const noexcept
 
void setThreadPolicy (int32_t rt_prio, int32_t rt_policy) noexcept
 
struct timespec * getTimeOut () noexcept
 

Private Attributes

std::atomic< bool > pRun
 
std::atomic< bool > pWait
 
std::atomic< bool > isWaiting
 
std::mutex pWaitWork
 
std::condition_variable pWorkCond
 
std::thread pThd
 
std::string threadName
 
uint32_t timeoutPeriod
 
pthread_mutex_t pWaitProc
 
pthread_cond_t pProcCond
 
struct timespec timeOut
 

Detailed Description

Definition at line 129 of file ParallelThread.h.

Constructor & Destructor Documentation

◆ ParallelThread()

ParallelThread::ParallelThread ( )
inline

Definition at line 133 of file ParallelThread.h.

◆ ~ParallelThread()

ParallelThread::~ParallelThread ( )
inline

Definition at line 147 of file ParallelThread.h.

Member Function Documentation

◆ getProcess()

bool ParallelThread::getProcess ( )
inlinenoexcept

Definition at line 181 of file ParallelThread.h.

◆ getState()

bool ParallelThread::getState ( ) const
inlineprivatenoexcept

Definition at line 312 of file ParallelThread.h.

Referenced by getProcess().

◆ getTimeOut()

struct timespec * ParallelThread::getTimeOut ( )
inlineprivatenoexcept

Definition at line 339 of file ParallelThread.h.

Referenced by getProcess(), and processWait().

◆ init()

void ParallelThread::init ( )
inlineprivatenoexcept

Definition at line 273 of file ParallelThread.h.

Referenced by ParallelThread().

◆ isRunning()

bool ParallelThread::isRunning ( ) const
inlinenoexcept

Definition at line 159 of file ParallelThread.h.

Referenced by getProcess(), processWait(), setPriority(), start(), and stop().

◆ processWait()

void ParallelThread::processWait ( )
inlinenoexcept

Definition at line 215 of file ParallelThread.h.

◆ run()

void ParallelThread::run ( )
inlineprivatenoexcept

Definition at line 283 of file ParallelThread.h.

Referenced by start().

◆ runProcess()

void ParallelThread::runProcess ( )
inlinenoexcept

Definition at line 204 of file ParallelThread.h.

◆ setPriority()

void ParallelThread::setPriority ( int32_t  rt_prio,
int32_t  rt_policy 
)
inlinenoexcept

Definition at line 170 of file ParallelThread.h.

◆ setThreadName()

void ParallelThread::setThreadName ( std::string  name)
inlinenoexcept

Definition at line 165 of file ParallelThread.h.

◆ setThreadPolicy()

void ParallelThread::setThreadPolicy ( int32_t  rt_prio,
int32_t  rt_policy 
)
inlineprivatenoexcept

Definition at line 317 of file ParallelThread.h.

Referenced by setPriority().

◆ setTimeOut()

void ParallelThread::setTimeOut ( uint32_t  timeout)
inlinenoexcept

Definition at line 176 of file ParallelThread.h.

◆ start()

void ParallelThread::start ( )
inlinenoexcept

Definition at line 154 of file ParallelThread.h.

◆ stop()

void ParallelThread::stop ( )
inlinenoexcept

Definition at line 237 of file ParallelThread.h.

Referenced by run(), and ~ParallelThread().

Member Data Documentation

◆ isWaiting

std::atomic<bool> ParallelThread::isWaiting
private

Definition at line 255 of file ParallelThread.h.

Referenced by getState(), and run().

◆ pProcCond

pthread_cond_t ParallelThread::pProcCond
private

Definition at line 269 of file ParallelThread.h.

Referenced by getProcess(), init(), processWait(), and run().

◆ pRun

std::atomic<bool> ParallelThread::pRun
private

Definition at line 253 of file ParallelThread.h.

Referenced by isRunning(), run(), stop(), and ~ParallelThread().

◆ pThd

std::thread ParallelThread::pThd
private

Definition at line 264 of file ParallelThread.h.

Referenced by isRunning(), run(), setThreadPolicy(), and stop().

◆ pWait

std::atomic<bool> ParallelThread::pWait
private

Definition at line 254 of file ParallelThread.h.

Referenced by getProcess(), processWait(), and run().

◆ pWaitProc

pthread_mutex_t ParallelThread::pWaitProc
private

Definition at line 268 of file ParallelThread.h.

Referenced by getProcess(), init(), and processWait().

◆ pWaitWork

std::mutex ParallelThread::pWaitWork
private

Definition at line 260 of file ParallelThread.h.

Referenced by run().

◆ pWorkCond

std::condition_variable ParallelThread::pWorkCond
private

Definition at line 261 of file ParallelThread.h.

Referenced by run(), runProcess(), and stop().

◆ threadName

std::string ParallelThread::threadName
private

Definition at line 265 of file ParallelThread.h.

Referenced by ParallelThread(), setThreadName(), and setThreadPolicy().

◆ timeOut

struct timespec ParallelThread::timeOut
private

Definition at line 270 of file ParallelThread.h.

Referenced by getTimeOut().

◆ timeoutPeriod

uint32_t ParallelThread::timeoutPeriod
private

Definition at line 266 of file ParallelThread.h.

Referenced by getTimeOut(), ParallelThread(), and setTimeOut().


The documentation for this class was generated from the following file: