Thread subsystem I.
More...
Go to the source code of this file.
◆ LWP_ALREADY_SUSPENDED
#define LWP_ALREADY_SUSPENDED 1 |
◆ LWP_CLOSED
◆ LWP_NOT_SUSPENDED
#define LWP_NOT_SUSPENDED 2 |
◆ LWP_PRIO_HIGHEST
#define LWP_PRIO_HIGHEST 127 |
◆ LWP_PRIO_IDLE
◆ LWP_SUCCESSFUL
◆ LWP_THREAD_NULL
#define LWP_THREAD_NULL 0xffffffff |
◆ LWP_TQUEUE_NULL
#define LWP_TQUEUE_NULL 0xffffffff |
◆ lwp_t
typedef for the thread context handle
◆ lwpq_t
typedef for the thread queue's context handle
◆ LWP_CloseQueue()
Close the thread synchronization queue and releas the handle.
- Parameters
-
[in] | thequeue | handle to the thread's synchronization queue |
- Returns
- none
◆ LWP_CreateThread()
◆ LWP_GetSelf()
Return the handle to the current thread.
- Returns
- thread context handle
◆ LWP_InitQueue()
Initialize the thread synchronization queue.
- Parameters
-
[in] | thequeue | pointer to a lwpq_t handle. |
- Returns
- 0 on success, <0 on error
◆ LWP_JoinThread()
Join the given thread.
- Parameters
-
[in] | thethread | handle to the thread's context which should be joined to wait on termination. |
[in] | value_ptr | pointer-pointer to a variable to receive the return code of the terminated thread. |
- Returns
- 0 on success, <0 on error
◆ LWP_Reschedule()
Reschedule all threads running at the given priority.
- Parameters
-
[in] | prio | priority level to reschedule |
- Returns
- none
◆ LWP_ResumeThread()
Resume the given thread.
- Parameters
-
[in] | thethread | handle to the thread context which should be resumed. |
- Returns
- 0 on success, <0 on error
◆ LWP_SetThreadPriority()
Set the priority of the given thread.
- Parameters
-
[in] | thethread | handle to the thread context whos priority should be changed. If NULL, the current thread will be taken. |
[in] | prio | new priority to set |
- Returns
- none
◆ LWP_SuspendThread()
s32 LWP_SuspendThread |
( |
lwp_t |
thethread | ) |
|
Suspend the given thread.
- Parameters
-
[in] | thethread | handle to the thread context which should be suspended. |
- Returns
- 0 on success, <0 on error
◆ LWP_ThreadBroadcast()
Removes all blocked threads from the thread synchronization queue and sets them back to running state.
- Parameters
-
[in] | thequeue | handle to the thread's synchronization queue to pop the blocked threads off |
- Returns
- none
◆ LWP_ThreadIsSuspended()
BOOL LWP_ThreadIsSuspended |
( |
lwp_t |
thethread | ) |
|
Test whether the given thread is suspended or not.
- Parameters
-
[in] | thethread | handle to the thread context which should be tested. |
- Returns
- TRUE or FALSE
◆ LWP_ThreadSignal()
Signals one thread to be revmoved from the thread synchronization queue and sets it back to running state.
- Parameters
-
[in] | thequeue | handle to the thread's synchronization queue to pop the blocked thread off |
- Returns
- none
◆ LWP_ThreadSleep()
Pushes the current thread onto the given thread synchronization queue and sets the thread state to blocked.
- Parameters
-
[in] | thequeue | handle to the thread's synchronization queue to push the thread on |
- Returns
- none
◆ LWP_YieldThread()
Yield the current thread to another one with higher priority or if not running at the same priority which state is runnable.
- Returns
- none