#include <worker_threads.hpp>
This class represents a working thread that calls the method ControlUnit::compute_next_value() for all connected units on request. The thread sleeps until it is activated using the public method executeOneStepForAllConnCUs().
◆ CUControllerWorkerThread() [1/2]
Constructs a new working thread for a list of controlled control units (CUs). Attention: A control unit MUST ONLY be connected to ONE working thread! Otherwise ControlUnit::compute_next_value() is called more than once for the control units connected!
- Parameters
-
| connected_units_ | The list of control units that are connected to this working thread |
| caller | The reference to the thread group manager object |
◆ CUControllerWorkerThread() [2/2]
Constructs a new working thread in the case of using work stealing.
- Parameters
-
| caller | The reference to the thread group manager object |
◆ ~CUControllerWorkerThread()
| CUControllerWorkerThread::~CUControllerWorkerThread |
( |
| ) |
|
◆ errorHappened()
| bool CUControllerWorkerThread::errorHappened |
( |
| ) |
const |
|
inline |
This method returns true if an error happend and complete simulation must be stopped.
◆ executeOneStepForAllConnCUs()
| void CUControllerWorkerThread::executeOneStepForAllConnCUs |
( |
unsigned long |
ts | ) |
|
This method notifies the thread to start working. This means that the thread will start to call ControlUnit::compute_next_value() iteratively for all control units connected. Basically, it sets atomic_flag_exec to true.
- Parameters
-
◆ isIdling()
| bool CUControllerWorkerThread::isIdling |
( |
| ) |
const |
|
inline |
This function returns true if the thread is idling, i.e., it is running, but not currently working and has also no planned work.
◆ start()
| void CUControllerWorkerThread::start |
( |
| ) |
|
◆ stop()
| void CUControllerWorkerThread::stop |
( |
| ) |
|
Stops this working thread.
The documentation for this class was generated from the following files: