An abstract class that represents contains the threadProc() that will be run in a separate thread.
More...
#include <etbasic.h>
|
static Void | sleep (Int milliseconds) |
| Sleeps for the specified number of milliseconds. More...
|
|
static Void | yield () |
| Relinquishes the CPU. More...
|
|
An abstract class that represents contains the threadProc() that will be run in a separate thread.
EThreadBasic is the base class that represents a single CPU thread. The function that will be called in the new thread is EThreadBasic::threadProc(). Additionally, EThreadBasic is one of the base classes used by the event thread base class EThreadBase.
◆ RunState
EThreadBasic run states.
Enumerator |
---|
rsWaitingToRun | the thread is waiting to run
|
rsRunning | the thread is running
|
rsDoneRunning | the threadProc has exited and the thread is no longer running
|
◆ EThreadBasic()
EThreadBasic::EThreadBasic |
( |
| ) |
|
◆ ~EThreadBasic()
EThreadBasic::~EThreadBasic |
( |
| ) |
|
|
virtual |
◆ cancelWait()
Int EThreadBasic::cancelWait |
( |
| ) |
|
Sends a cancellation request to the thread.
- Returns
- 0 if successful otherwise a nonzero error number.
Sends a cancellation request to the thread. Whether and when the target thread reacts to the cancellation request depends on two attributes that are under the control of that thread: its cancelability state and type. See pthread_cancel() for more information.
◆ getRunState()
◆ init()
Void EThreadBasic::init |
( |
pVoid |
arg, |
|
|
size_t |
stackSize = 0 |
|
) |
| |
Initialize and start the thread.
- Parameters
-
arg | the threadProc() argument |
stackSize | the stack size for the new thread, 0 - default stack size |
- Exceptions
-
Initializes and starts the thread with the specified argument and stack size. A stackSize of 0 corresponds to the default stack size.
◆ Initialize()
Void EThreadBasic::Initialize |
( |
| ) |
|
|
staticprotected |
performs internal initialization *** DO NOT CALL ***
◆ isDoneRunning()
Bool EThreadBasic::isDoneRunning |
( |
| ) |
|
|
inline |
Determines if the thread has finished running.
- Returns
- indicates if the thread is finished running or not
Returns True if the thread is in the rsDoneRunning state and False if it is not.
◆ isInitialized()
Bool EThreadBasic::isInitialized |
( |
| ) |
|
Returns the thread initialization state.
- Returns
- the initialization status
Returns True if the thread has been initialized and False if not.
◆ isRunning()
Bool EThreadBasic::isRunning |
( |
| ) |
|
|
inline |
Determines if the thread is running.
- Returns
- indicates if the thread is running or not
Returns True if the thread is in the rsRunning state and False if it is not.
◆ isWaitingToRun()
Bool EThreadBasic::isWaitingToRun |
( |
| ) |
|
|
inline |
Determines if the thread is waiting to run.
- Returns
- indicates if the thread is waiting to run or not
Returns True if the thread is in the rsWaitingToRun state and False if it is not.
◆ join()
Void EThreadBasic::join |
( |
| ) |
|
Waits for the thread to terminate.
- Exceptions
-
Suspends the execution of the calling thread until the thread associated with this object terminates.
◆ signal()
Void EThreadBasic::signal |
( |
Int |
sig | ) |
|
|
inline |
◆ sleep()
Void EThreadBasic::sleep |
( |
Int |
milliseconds | ) |
|
|
static |
Sleeps for the specified number of milliseconds.
Causes the calling thread to sleep for the specified number of milliseconds.
◆ threadProc()
virtual Dword EThreadBasic::threadProc |
( |
pVoid |
arg | ) |
|
|
pure virtual |
Function that will be called in a separate thread.
- Parameters
-
This pure virtual function must be overridden in the derived class. The code in the derived class will be executed in a separate thread.
◆ UnInitialize()
Void EThreadBasic::UnInitialize |
( |
| ) |
|
|
staticprotected |
performs internal de-initialization *** DO NOT CALL ***
◆ yield()
Void EThreadBasic::yield |
( |
| ) |
|
|
static |
Relinquishes the CPU.
Causes the calling thread to relinquish the CPU. The thread is moved to the end of the queue for its static priority and another thread gets to run.
◆ EpcTools
◆ EThreadBase
The documentation for this class was generated from the following files:
- /home/vagrant/share/code/epctools/include/epc/etbasic.h
- /home/vagrant/share/code/epctools/src/etbasic.cpp