![]() |
SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Wait object. More...
#include <stk_common.h>
Public Types | |
| typedef DLHeadType | ListHeadType |
| List head type for IWaitObject elements. | |
| typedef DLEntryType | ListEntryType |
| List entry type of IWaitObject elements. | |
| typedef DListEntry< IWaitObject, _ClosedLoop > | DLEntryType |
| Convenience alias for this entry type. Used to avoid repeating the full template spelling. | |
| typedef DListHead< IWaitObject, _ClosedLoop > | DLHeadType |
| Convenience alias for the corresponding list head type. | |
Public Member Functions | |
| virtual TId | GetTid () const =0 |
| Get thread Id of this task. | |
| virtual void | Wake (bool timeout)=0 |
| Wake task. | |
| virtual bool | IsTimeout () const =0 |
| Check if task woke up due to a timeout. | |
| virtual bool | Tick (Timeout elapsed_ticks)=0 |
| Update wait object's waiting time. | |
| DLHeadType * | GetHead () const |
| Get the list head this entry currently belongs to. | |
| DLEntryType * | GetNext () const |
| Get the next entry in the list. | |
| DLEntryType * | GetPrev () const |
| Get the previous entry in the list. | |
| bool | IsLinked () const |
| Check whether this entry is currently a member of any list. | |
| operator IWaitObject * () | |
| Implicit conversion to a mutable pointer to the host object (T). | |
| operator const IWaitObject * () const | |
| Implicit conversion to a const pointer to the host object (T). | |
Private Member Functions | |
| void | Link (DLHeadType *head, DLEntryType *next, DLEntryType *prev) |
| Wire this entry into a list between prev and next. | |
| void | Unlink () |
| Remove this entry from its current list. | |
Private Attributes | |
| DLHeadType * | m_head |
Owning list head, or NULL when the entry is not linked. | |
| DLEntryType * | m_next |
Next entry in the list, or NULL (open list boundary) / first entry (closed loop). | |
| DLEntryType * | m_prev |
Previous entry in the list, or NULL (open list boundary) / last entry (closed loop). | |
Wait object.
Definition at line 211 of file stk_common.h.
|
inherited |
Convenience alias for this entry type. Used to avoid repeating the full template spelling.
Definition at line 70 of file stk_linked_list.h.
|
inherited |
Convenience alias for the corresponding list head type.
Definition at line 75 of file stk_linked_list.h.
List entry type of IWaitObject elements.
Definition at line 222 of file stk_common.h.
List head type for IWaitObject elements.
Definition at line 217 of file stk_common.h.
|
inlineinherited |
Get the list head this entry currently belongs to.
NULL if the entry is not linked. Definition at line 80 of file stk_linked_list.h.
|
inlineinherited |
Get the next entry in the list.
NULL if this is the last entry (open list) or the first entry (closed loop, where next wraps to first). _ClosedLoop == true) this pointer is never NULL when the entry is linked. Definition at line 88 of file stk_linked_list.h.
|
inlineinherited |
Get the previous entry in the list.
NULL if this is the first entry (open list) or the last entry (closed loop, where prev wraps to last). _ClosedLoop == true) this pointer is never NULL when the entry is linked. Definition at line 96 of file stk_linked_list.h.
|
pure virtual |
Get thread Id of this task.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject.
Referenced by stk::test::TEST(), stk::test::Test_SyncWait(), and stk::sync::Mutex::Unlock().
|
inlineinherited |
Check whether this entry is currently a member of any list.
true if linked (m_head != NULL); false otherwise. Definition at line 101 of file stk_linked_list.h.
|
pure virtual |
Check if task woke up due to a timeout.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject.
Referenced by stk::sync::Event::RemoveWaitObject(), stk::test::TEST(), stk::test::TEST(), stk::test::Test_SyncWait(), stk::sync::Mutex::TimedLock(), stk::sync::ConditionVariable::Wait(), stk::sync::Event::Wait(), and stk::sync::Semaphore::Wait().
|
inlineprivateinherited |
Wire this entry into a list between prev and next.
| [in] | head | The owning DListHead. Stored as a back-pointer for IsLinked() and ownership checks. |
| [in] | next | The entry that will follow this one, or NULL if this becomes the last entry. |
| [in] | prev | The entry that will precede this one, or NULL if this becomes the first entry. |
Definition at line 137 of file stk_linked_list.h.
|
inlineinherited |
Implicit conversion to a const pointer to the host object (T).
Definition at line 115 of file stk_linked_list.h.
|
inlineinherited |
Implicit conversion to a mutable pointer to the host object (T).
Definition at line 108 of file stk_linked_list.h.
|
pure virtual |
Update wait object's waiting time.
| [in] | elapsed_ticks | Number of ticks elapsed between this and previous calls, in case of KERNEL_TICKLESS mode this value can be >1, for non-tickless mode it is always 1. |
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject.
Referenced by stk::ISyncObject::Tick().
|
inlineprivateinherited |
Remove this entry from its current list.
Definition at line 157 of file stk_linked_list.h.
|
pure virtual |
Wake task.
| [in] | timeout | Pass true if the task is waking due to timeout expiry. false if waking due to a successful signal. |
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::WaitObject.
Referenced by stk::ISyncObject::Tick(), stk::sync::Mutex::Unlock(), stk::ISyncObject::WakeAll(), and stk::ISyncObject::WakeOne().
|
privateinherited |
Owning list head, or NULL when the entry is not linked.
Definition at line 170 of file stk_linked_list.h.
|
privateinherited |
Next entry in the list, or NULL (open list boundary) / first entry (closed loop).
Definition at line 171 of file stk_linked_list.h.
|
privateinherited |
Previous entry in the list, or NULL (open list boundary) / last entry (closed loop).
Definition at line 172 of file stk_linked_list.h.