|
jaffarCommon
|
#include <dethreader.hpp>
Public Types | |
| enum | returnReason_t { none , finished , sleeping , waiting } |
Public Member Functions | |
| Thread (const Thread &)=delete | |
| void | operator= (const Thread &)=delete |
| Thread (const threadFc_t fc, const threadId_t id) | |
| ~Thread () | |
| __JAFFAR_COMMON__INLINE__ void | run () const |
| __JAFFAR_COMMON__INLINE__ void | yield () |
| __JAFFAR_COMMON__INLINE__ returnReason_t | getReturnReason () const |
| __JAFFAR_COMMON__INLINE__ void | sleep (const size_t sleepDuration) |
| __JAFFAR_COMMON__INLINE__ bool | joinable () |
| __JAFFAR_COMMON__INLINE__ void | join (const threadId_t threadId) |
| __JAFFAR_COMMON__INLINE__ threadId_t | getThreadId () const |
Public Attributes | |
| threadId_t | _threadWaitedFor |
Friends | |
| class | Runtime |
Represents a simulated execution thread
|
inline |
Constructor
| [in] | fc | The (lambda) function to be executed |
| [in] | id | The unique identifier for the thread |
It creates the thread coroutine on construction
|
inline |
This destructor frees up the coroutine stack memory
|
inline |
Returns the reason why the thread has returned
|
inline |
Function to get the thread's id
|
inline |
Function to wait for a thread completion
| [in] | threadId | Identifier of the thread to wait for |
|
inline |
States whether the thread is joinable
|
inline |
Runs or resume an already created thread.
That is, unless the thread is sleeping
|
inline |
Function to send the thread to sleep
| [in] | sleepDuration | The number of microseconds to sleep for |
|
inline |
Yields execution to the runtime
| threadId_t jaffarCommon::dethreader::Runtime::Thread::_threadWaitedFor |
The thread this thread is waiting for