The BlockingObject class. Class implementing thread-blocking primatives. used for implementing things like semaphores, mutexes, message queues, or anything else that could cause a thread to suspend execution on some external stimulus.
More...
#include <blocking.h>
|
void | Block (Thread *pclThread_) |
| Block Blocks a thread on this object. This is the fundamental operation performed by any sort of blocking operation in the operating system. All semaphores/mutexes/sleeping/messaging/etc ends up going through the blocking code at some point as part of the code that manages a transition from an "active" or "waiting" thread to a "blocked" thread. More...
|
|
void | BlockPriority (Thread *pclThread_) |
| BlockPriority Same as Block(), but ensures that threads are added to the block-list in priority-order, which optimizes the unblock procedure. More...
|
|
void | UnBlock (Thread *pclThread_) |
| UnBlock Unblock a thread that is already blocked on this object, returning it to the "ready" state by performing the following steps: More...
|
|
void | SetInitialized (void) |
| SetInitialized. More...
|
|
bool | IsInitialized (void) |
| IsInitialized. More...
|
|
The BlockingObject class. Class implementing thread-blocking primatives. used for implementing things like semaphores, mutexes, message queues, or anything else that could cause a thread to suspend execution on some external stimulus.
Definition at line 65 of file blocking.h.
◆ BlockingObject()
Mark3::BlockingObject::BlockingObject |
( |
| ) |
|
|
inline |
◆ ~BlockingObject()
Mark3::BlockingObject::~BlockingObject |
( |
| ) |
|
|
inline |
◆ Block()
void Mark3::BlockingObject::Block |
( |
Thread * |
pclThread_ | ) |
|
|
protected |
Block Blocks a thread on this object. This is the fundamental operation performed by any sort of blocking operation in the operating system. All semaphores/mutexes/sleeping/messaging/etc ends up going through the blocking code at some point as part of the code that manages a transition from an "active" or "waiting" thread to a "blocked" thread.
The steps involved in blocking a thread (which are performed in the function itself) are as follows;
1) Remove the specified thread from the current owner's list (which is likely one of the scheduler's thread lists) 2) Add the thread to this object's thread list 3) Setting the thread's "current thread-list" point to reference this object's threadlist.
- Parameters
-
pclThread_ | Pointer to the thread object that will be blocked. |
Definition at line 26 of file blocking.cpp.
◆ BlockPriority()
void Mark3::BlockingObject::BlockPriority |
( |
Thread * |
pclThread_ | ) |
|
|
protected |
BlockPriority Same as Block(), but ensures that threads are added to the block-list in priority-order, which optimizes the unblock procedure.
- Parameters
-
pclThread_ | Pointer to the Thread to Block. |
Definition at line 41 of file blocking.cpp.
◆ IsInitialized()
bool Mark3::BlockingObject::IsInitialized |
( |
void |
| ) |
|
|
inlineprotected |
IsInitialized.
- Returns
- true if initialized, false if object uninitialized
Definition at line 123 of file blocking.h.
◆ SetInitialized()
void Mark3::BlockingObject::SetInitialized |
( |
void |
| ) |
|
|
inlineprotected |
◆ UnBlock()
void Mark3::BlockingObject::UnBlock |
( |
Thread * |
pclThread_ | ) |
|
|
protected |
UnBlock Unblock a thread that is already blocked on this object, returning it to the "ready" state by performing the following steps:
- Parameters
-
pclThread_ | Pointer to the thread to unblock. |
1) Removing the thread from this object's threadlist 2) Restoring the thread to its "original" owner's list
Definition at line 56 of file blocking.cpp.
◆ m_clBlockList
ThreadList which is used to hold the list of threads blocked on a given object.
Definition at line 133 of file blocking.h.
◆ m_u8Initialized
uint8_t Mark3::BlockingObject::m_u8Initialized |
|
protected |
Token used to check whether or not the object has been initialized prior to use.
Definition at line 139 of file blocking.h.
◆ m_uBlockingInitCookie
constexpr auto Mark3::BlockingObject::m_uBlockingInitCookie = uint8_t { 0xC3 } |
|
staticprotected |
◆ m_uBlockingInvalidCookie
constexpr auto Mark3::BlockingObject::m_uBlockingInvalidCookie = uint8_t { 0x3C } |
|
staticprotected |
The documentation for this class was generated from the following files:
- /mnt/c/Users/moslevin/m3-repo2/kernel/src/public/blocking.h
- /mnt/c/Users/moslevin/m3-repo2/kernel/src/blocking.cpp