Simple thread class.
More...
#include <erpc_threading.h>
|
|
typedef void * | thread_id_t |
| | Unique identifier for a thread.
|
| |
|
typedef void * | thread_stack_pointer |
| |
| Thread::Thread |
( |
const char * |
name = 0 | ) |
|
Default constructor for use with the init() method.
If this constructor is used, the init() method must be called before the thread can be started.
- Parameters
-
| [in] | name | Optional name for the thread. |
| Thread::Thread |
( |
thread_entry_t |
entry, |
|
|
uint32_t |
priority = 0, |
|
|
uint32_t |
stackSize = 0, |
|
|
const char * |
name = 0, |
|
|
thread_stack_pointer |
stackPtr = 0 |
|
) |
| |
Constructor.
This constructor fully initializes the thread object.
- Parameters
-
| [in] | entry | |
| [in] | priority | |
| [in] | stackSize | |
| [in] | name | Optional name for the thread. |
| [in] | stackPtr | Mandatory task stack pointer for static api usage. |
| void erpc::Thread::setName |
( |
const char * |
name | ) |
|
|
inline |
This function sets name for thread.
- Parameters
-
| const char* erpc::Thread::getName |
( |
void |
| ) |
const |
|
inline |
This function returns name of thread.
- Returns
- Name of thread.
| void Thread::init |
( |
thread_entry_t |
entry, |
|
|
uint32_t |
priority = 0, |
|
|
uint32_t |
stackSize = 0, |
|
|
thread_stack_pointer |
stackPtr = 0 |
|
) |
| |
This function initializes thread.
- Parameters
-
| [in] | entry | Entry function. |
| [in] | priority | Task priority. |
| [in] | stackSize | Stack size. |
| [in] | stackPtr | Mandatory task stack pointer for static api usage. |
| void Thread::start |
( |
void * |
arg = 0 | ) |
|
This function starts thread execution.
- Parameters
-
| [in] | arg | Function argument. |
| void Thread::sleep |
( |
uint32_t |
usecs | ) |
|
|
static |
This function puts thread to sleep.
- Parameters
-
| [in] | usecs | Time for sleeping. |
This function returns current thread id.
- Returns
- Thread id.
| static thread_id_t erpc::Thread::getCurrentThreadId |
( |
void |
| ) |
|
|
inlinestatic |
This function returns thread id where function is called.
- Returns
- Thread id.
| Thread * Thread::getCurrentThread |
( |
void |
| ) |
|
|
static |
This function returns Thread instance where functions is called.
- Returns
- Thread instance.
| bool Thread::operator== |
( |
Thread & |
o | ) |
|
Compare operator compares two threads.
- Parameters
-
- Return values
-
| true | When threads are same. |
| false | When threads aren't same. |
The documentation for this class was generated from the following files: