SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stk_common.h
Go to the documentation of this file.
1/*
2 * SuperTinyKernel(TM) RTOS: Lightweight High-Performance Deterministic C++ RTOS for Embedded Systems.
3 *
4 * Source: https://github.com/SuperTinyKernel-RTOS
5 *
6 * Copyright (c) 2022-2026 Neutron Code Limited <stk@neutroncode.com>. All Rights Reserved.
7 * License: MIT License, see LICENSE for a full text.
8 */
9
10#ifndef STK_COMMON_H_
11#define STK_COMMON_H_
12
13#include "stk_defs.h"
14#include "stk_linked_list.h"
15
19
20namespace stk {
21
22// Forward declarations:
23class IKernelService;
24class IKernelTask;
25
30enum EAccessMode : int32_t
31{
34};
35
39enum EKernelMode : uint8_t
40{
41 KERNEL_STATIC = (1 << 0),
42 KERNEL_DYNAMIC = (1 << 1),
43 KERNEL_HRT = (1 << 2),
44 KERNEL_SYNC = (1 << 3),
45 KERNEL_TICKLESS = (1 << 4),
46};
47
64
75
85
90{
91 SYS_TASK_ID_SLEEP = 0xFFFFFFFF,
92 SYS_TASK_ID_EXIT = 0xFFFFFFFE
93};
94
104
112typedef uintptr_t Word;
113
117typedef Word TId;
118
123const TId TID_ISR = static_cast<TId>(~0);
124
128const TId TID_NONE = static_cast<TId>(0);
129
133typedef int32_t Timeout;
134
139const Timeout WAIT_INFINITE = INT32_MAX;
140
145const Timeout NO_WAIT = 0;
146
150typedef int64_t Ticks;
151
155typedef uint64_t Cycles;
156
167template <size_t _StackSize> struct StackMemoryDef
168{
169 enum { SIZE = _StackSize };
170
175};
176
180struct Stack
181{
184#if STK_NEED_TASK_ID
185 TId tid;
186#endif
187};
188
193{
194public:
197 virtual Word *GetStack() const = 0;
198
201 virtual size_t GetStackSize() const = 0;
202
205 virtual size_t GetStackSizeBytes() const = 0;
206};
207
211class IWaitObject : public util::DListEntry<IWaitObject, false>
212{
213public:
218
223
227 virtual TId GetTid() const = 0;
228
235 virtual void Wake(bool timeout) = 0;
236
240 virtual bool IsTimeout() const = 0;
241
247 virtual bool Tick(Timeout elapsed_ticks) = 0;
248};
249
255{
256public:
257#if STK_SYNC_DEBUG_NAMES
258 ITraceable() : m_trace_name(nullptr)
259 {}
260#endif
261
266 void SetTraceName(const char *name)
267 {
268 #if STK_SYNC_DEBUG_NAMES
269 m_trace_name = name;
270 #else
271 (void)name;
272 #endif
273 }
274
278 const char *GetTraceName() const
279 {
280 #if STK_SYNC_DEBUG_NAMES
281 return m_trace_name;
282 #else
283 return nullptr;
284 #endif
285 }
286
287protected:
288#if STK_SYNC_DEBUG_NAMES
289 const char *m_trace_name;
290#endif
291};
292
296class ISyncObject : public util::DListEntry<ISyncObject, false>
297{
298public:
303 {}
304
309
314
318 virtual void AddWaitObject(IWaitObject *wobj)
319 {
320 STK_ASSERT(wobj->GetHead() == nullptr);
321 m_wait_list.LinkBack(wobj);
322 }
323
327 virtual void RemoveWaitObject(IWaitObject *wobj)
328 {
329 STK_ASSERT(wobj->GetHead() == &m_wait_list);
330 m_wait_list.Unlink(wobj);
331 }
332
344 virtual bool Tick(Timeout elapsed_ticks);
345
346protected:
351 {}
352
357 void WakeOne()
358 {
359 if (!m_wait_list.IsEmpty())
360 static_cast<IWaitObject *>(m_wait_list.GetFirst())->Wake(false);
361 }
362
367 void WakeAll()
368 {
369 while (!m_wait_list.IsEmpty())
370 static_cast<IWaitObject *>(m_wait_list.GetFirst())->Wake(false);
371 }
372
374};
375
381{
382public:
389 {
390 public:
391 explicit ScopedLock(IMutex &mutex) : m_mutex(mutex) { m_mutex.Lock(); }
392 ~ScopedLock() { m_mutex.Unlock(); }
393
394 private:
396
398 };
399
402 virtual void Lock() = 0;
403
406 virtual void Unlock() = 0;
407};
408
432class ITask : public IStackMemory
433{
434public:
449 virtual void Run() = 0;
450
453 virtual EAccessMode GetAccessMode() const = 0;
454
462 virtual void OnDeadlineMissed(uint32_t duration) = 0;
463
468 virtual int32_t GetWeight() const = 0;
469
474 virtual TId GetId() const = 0;
475
480 virtual const char *GetTraceName() const = 0;
481};
482
492class IKernelTask : public util::DListEntry<IKernelTask, true>
493{
494public:
499
504
507 virtual ITask *GetUserTask() = 0;
508
511 virtual Stack *GetUserStack() = 0;
512
518 virtual int32_t GetWeight() const = 0;
519
525 virtual void SetCurrentWeight(int32_t weight) = 0;
526
532 virtual int32_t GetCurrentWeight() const = 0;
533
537 virtual Timeout GetHrtPeriodicity() const = 0;
538
542 virtual Timeout GetHrtDeadline() const = 0;
543
547 virtual Timeout GetHrtRelativeDeadline() const = 0;
548
552 virtual bool IsSleeping() const = 0;
553
559 virtual void Wake() = 0;
560};
561
575{
576public:
583 {
584 public:
589 virtual void OnStart(Stack *&active) = 0;
590
595 virtual void OnStop() = 0;
596
611 virtual bool OnTick(Stack *&idle, Stack *&active
613 , Timeout &ticks
614 #endif
615 ) = 0;
616
620 virtual void OnTaskSwitch(Word caller_SP) = 0;
621
626 virtual void OnTaskSleep(Word caller_SP, Timeout ticks) = 0;
627
632 virtual void OnTaskSleepUntil(Word caller_SP, Ticks timestamp) = 0;
633
637 virtual void OnTaskExit(Stack *stack) = 0;
638
645 virtual IWaitObject *OnTaskWait(Word caller_SP, ISyncObject *sync_obj, IMutex *mutex, Timeout timeout) = 0;
646
651 virtual TId OnGetTid(Word caller_SP) = 0;
652 };
653
659 {
660 public:
664 virtual bool OnSleep() = 0;
665
670 virtual bool OnHardFault() = 0;
671 };
672
680 virtual void Initialize(IEventHandler *event_handler, IKernelService *service, uint32_t resolution_us, Stack *exit_trap) = 0;
681
686 virtual void Start() = 0;
687
690 virtual void Stop() = 0;
691
699 virtual bool InitStack(EStackType stack_type, Stack *stack, IStackMemory *stack_memory, ITask *user_task) = 0;
700
705 virtual uint32_t GetTickResolution() const = 0;
706
709 virtual void SwitchToNext() = 0;
710
715 virtual void Sleep(Timeout ticks) = 0;
716
723 virtual void SleepUntil(Ticks timestamp) = 0;
724
734 virtual void ProcessTick() = 0;
735
739 virtual void ProcessHardFault() = 0;
740
745 virtual void SetEventOverrider(IEventOverrider *overrider) = 0;
746
751 virtual Word GetCallerSP() const = 0;
752
756 virtual TId GetTid() const = 0;
757};
758
782{
783public:
788 virtual void AddTask(IKernelTask *task) = 0;
789
794 virtual void RemoveTask(IKernelTask *task) = 0;
795
799 virtual IKernelTask *GetFirst() const = 0;
800
807 virtual IKernelTask *GetNext() = 0;
808
812 virtual size_t GetSize() const = 0;
813
818 virtual void OnTaskSleep(IKernelTask *task) = 0;
819
824 virtual void OnTaskWake(IKernelTask *task) = 0;
825
846 virtual bool OnTaskDeadlineMissed(IKernelTask *task) = 0;
847};
848
854{
855public:
865
875 virtual void Initialize(uint32_t resolution_us = PERIODICITY_DEFAULT) = 0;
876
881 virtual void AddTask(ITask *user_task) = 0;
882
890 virtual void AddTask(ITask *user_task, Timeout periodicity_tc, Timeout deadline_tc, Timeout start_delay_tc) = 0;
891
895 virtual void RemoveTask(ITask *user_task) = 0;
896
901 virtual void Start() = 0;
902
907 virtual EState GetState() const = 0;
908
912 virtual IPlatform *GetPlatform() = 0;
913
918};
919
929{
930public:
933 static IKernelService *GetInstance();
934
939 virtual TId GetTid() const = 0;
940
945 virtual Ticks GetTicks() const = 0;
946
952 virtual int32_t GetTickResolution() const = 0;
953
961 virtual void Delay(Timeout ticks) = 0;
962
969 virtual void Sleep(Timeout ticks) = 0;
970
977 virtual void SleepUntil(Ticks timestamp) = 0;
978
983 virtual void SwitchToNext() = 0;
984
998 virtual IWaitObject *Wait(ISyncObject *sobj, IMutex *mutex, Timeout timeout) = 0;
999};
1000
1001} // namespace stk
1002
1003#endif /* STK_COMMON_H_ */
Compiler and platform low-level definitions for STK.
#define STK_TICKLESS_IDLE
Enables tickless (dynamic-tick) low-power operation during idle periods.
Definition stk_defs.h:36
#define __stk_aligned(x)
Specifies minimum alignment in bytes for the decorated variable or struct member (data instance prefi...
Definition stk_defs.h:118
#define STK_NONCOPYABLE_CLASS(TYPE)
Disables copy construction and assignment for a class.
Definition stk_defs.h:517
#define STK_ASSERT(e)
Runtime assertion. Halts execution if the expression e evaluates to false.
Definition stk_defs.h:330
#define STK_STACK_SIZE_MIN
Minimum stack size in elements of Word, shared by all stack allocation lower-bound checks.
Definition stk_defs.h:454
#define STK_STACK_MEMORY_ALIGN
Stack memory alignment.
Definition stk_defs.h:389
Intrusive doubly-linked list implementation used internally by the kernel.
Namespace of STK package.
uintptr_t Word
Native processor word type.
Definition stk_common.h:112
ETraceEventId
Trace event id for tracing tasks suspension and resume with debugging tools (SEGGER SysView and etc....
Definition stk_common.h:99
@ TRACE_EVENT_UNKNOWN
Definition stk_common.h:100
@ TRACE_EVENT_SLEEP
Definition stk_common.h:102
@ TRACE_EVENT_SWITCH
Definition stk_common.h:101
const TId TID_ISR
Reserved task/thread id representing an ISR context.
Definition stk_common.h:123
const Timeout WAIT_INFINITE
Timeout value: block indefinitely until the synchronization object is signaled.
Definition stk_common.h:139
int64_t Ticks
Ticks value.
Definition stk_common.h:150
int32_t Timeout
Timeout time (ticks).
Definition stk_common.h:133
EStackType
Stack type.
Definition stk_common.h:70
@ STACK_SLEEP_TRAP
Stack of the Sleep trap.
Definition stk_common.h:72
@ STACK_USER_TASK
Stack of the user task.
Definition stk_common.h:71
@ STACK_EXIT_TRAP
Stack of the Exit trap.
Definition stk_common.h:73
const Timeout NO_WAIT
Timeout value: return immediately if the synchronization object is not yet signaled (non-blocking pol...
Definition stk_common.h:145
EConsts
Constants.
Definition stk_common.h:80
@ PERIODICITY_DEFAULT
Default periodicity (microseconds), 1 millisecond.
Definition stk_common.h:82
@ STACK_SIZE_MIN
Minimum stack size in elements of Word. Used as a lower bound for all stack allocations (user task,...
Definition stk_common.h:83
@ PERIODICITY_MAX
Maximum periodicity (microseconds), 99 milliseconds (note: this value is the highest working on a rea...
Definition stk_common.h:81
ESystemTaskId
System task id.
Definition stk_common.h:90
@ SYS_TASK_ID_EXIT
Exit trap.
Definition stk_common.h:92
@ SYS_TASK_ID_SLEEP
Sleep trap.
Definition stk_common.h:91
uint64_t Cycles
Cycles value.
Definition stk_common.h:155
Word TId
Definition stk_common.h:117
const TId TID_NONE
Reserved task/thread id representing zero/none thread id.
Definition stk_common.h:128
EAccessMode
Hardware access mode by the user task.
Definition stk_common.h:31
@ ACCESS_USER
Unprivileged access mode (access to some hardware is restricted, see CPU manual for details).
Definition stk_common.h:32
@ ACCESS_PRIVILEGED
Privileged access mode (access to hardware is fully unrestricted).
Definition stk_common.h:33
EKernelMode
Kernel operating mode.
Definition stk_common.h:40
@ KERNEL_TICKLESS
Tickless mode. To use this mode STK_TICKLESS_IDLE must be defined to 1 in stk_config....
Definition stk_common.h:45
@ KERNEL_SYNC
Synchronization support (see Event).
Definition stk_common.h:44
@ KERNEL_HRT
Hard Real-Time (HRT) behavior (tasks are scheduled periodically and have an execution deadline,...
Definition stk_common.h:43
@ KERNEL_STATIC
All tasks are static and can not exit.
Definition stk_common.h:41
@ KERNEL_DYNAMIC
Tasks can be added or removed and therefore exit when done.
Definition stk_common.h:42
EKernelPanicId
Identifies the source of a kernel panic.
Definition stk_common.h:52
@ KERNEL_PANIC_UNKNOWN_SVC
Unknown service command received by SVC handler.
Definition stk_common.h:60
@ KERNEL_PANIC_BAD_MODE
Kernel is in bad/unsupported mode for the current operation.
Definition stk_common.h:62
@ KERNEL_PANIC_HRT_HARD_FAULT
Kernel running in KERNEL_HRT mode reported deadline failure of the task.
Definition stk_common.h:57
@ KERNEL_PANIC_CS_NESTING_OVERFLOW
Critical section nesting limit exceeded: violation of STK_CRITICAL_SECTION_NESTINGS_MAX.
Definition stk_common.h:59
@ KERNEL_PANIC_NONE
Panic is absent (no fault).
Definition stk_common.h:53
@ KERNEL_PANIC_CPU_EXCEPTION
CPU reported an exception and halted execution.
Definition stk_common.h:58
@ KERNEL_PANIC_STACK_CORRUPT
Stack integrity check failed.
Definition stk_common.h:55
@ KERNEL_PANIC_SPINLOCK_DEADLOCK
Spin-lock timeout expired: lock owner never released.
Definition stk_common.h:54
@ KERNEL_PANIC_BAD_STATE
Kernel entered unexpected (bad) state.
Definition stk_common.h:61
@ KERNEL_PANIC_ASSERT
Internal assertion failed (maps from STK_ASSERT).
Definition stk_common.h:56
Stack memory type definition.
Definition stk_common.h:168
Word Type[_StackSize]
Stack memory type.
Definition stk_common.h:174
Stack descriptor.
Definition stk_common.h:181
Word SP
Stack Pointer (SP) register (note: must be the first entry in this struct).
Definition stk_common.h:182
EAccessMode mode
access mode
Definition stk_common.h:183
Interface for a stack memory region.
Definition stk_common.h:193
virtual size_t GetStackSizeBytes() const =0
Get size of the memory in bytes.
virtual size_t GetStackSize() const =0
Get number of elements of the stack memory array.
virtual Word * GetStack() const =0
Get pointer to the stack memory.
Wait object.
Definition stk_common.h:212
DLEntryType ListEntryType
List entry type of IWaitObject elements.
Definition stk_common.h:222
DLHeadType ListHeadType
List head type for IWaitObject elements.
Definition stk_common.h:217
virtual TId GetTid() const =0
Get thread Id of this task.
virtual bool IsTimeout() const =0
Check if task woke up due to a timeout.
virtual void Wake(bool timeout)=0
Wake task.
virtual bool Tick(Timeout elapsed_ticks)=0
Update wait object's waiting time.
Traceable object.
Definition stk_common.h:255
const char * GetTraceName() const
Get name.
Definition stk_common.h:278
void SetTraceName(const char *name)
Set name.
Definition stk_common.h:266
Synchronization object.
Definition stk_common.h:297
IWaitObject::ListHeadType m_wait_list
tasks blocked on this object
Definition stk_common.h:373
virtual bool Tick(Timeout elapsed_ticks)
Called by kernel on every system tick to handle timeout logic of waiting tasks.
Definition stk_arch.h:467
DLEntryType ListEntryType
List entry type of ISyncObject elements.
Definition stk_common.h:313
void WakeOne()
Wake the first task in the wait list (FIFO order).
Definition stk_common.h:357
ISyncObject()
Constructor.
Definition stk_common.h:350
virtual void AddWaitObject(IWaitObject *wobj)
Called by kernel when a new task starts waiting on this event.
Definition stk_common.h:318
DLHeadType ListHeadType
List head type for ISyncObject elements.
Definition stk_common.h:308
~ISyncObject()
Destructor.
Definition stk_common.h:302
void WakeAll()
Wake all tasks currently in the wait list.
Definition stk_common.h:367
virtual void RemoveWaitObject(IWaitObject *wobj)
Called by kernel when a waiting task is being removed (timeout expired, wait aborted,...
Definition stk_common.h:327
Interface for mutex synchronization primitive.
Definition stk_common.h:381
virtual void Unlock()=0
Unlock the mutex.
virtual void Lock()=0
Lock the mutex.
ScopedLock(IMutex &mutex)
Definition stk_common.h:391
Interface for a user task.
Definition stk_common.h:433
virtual EAccessMode GetAccessMode() const =0
Get hardware access mode of the user task.
virtual void Run()=0
Entry point of the user task.
virtual TId GetId() const =0
Get task Id set by application.
virtual void OnDeadlineMissed(uint32_t duration)=0
Called by the scheduler if deadline of the task is missed when Kernel is operating in Hard Real-Time ...
virtual const char * GetTraceName() const =0
Get task trace name set by application.
virtual int32_t GetWeight() const =0
Get static base weight of the task.
Scheduling-strategy-facing interface for a kernel task slot.
Definition stk_common.h:493
virtual void Wake()=0
Wake a sleeping task on the next scheduling tick.
DLEntryType ListEntryType
List entry type of IKernelTask elements.
Definition stk_common.h:503
virtual Stack * GetUserStack()=0
Get pointer to the user task's stack.
virtual int32_t GetCurrentWeight() const =0
Get the current dynamic weight value of this task.
virtual Timeout GetHrtRelativeDeadline() const =0
Get HRT task's relative deadline.
virtual Timeout GetHrtDeadline() const =0
Get HRT task deadline (max allowed task execution time).
DLHeadType ListHeadType
List head type for IKernelTask elements.
Definition stk_common.h:498
virtual bool IsSleeping() const =0
Check whether the task is currently sleeping.
virtual Timeout GetHrtPeriodicity() const =0
Get HRT task execution periodicity.
virtual void SetCurrentWeight(int32_t weight)=0
Set the current dynamic weight value used by the scheduling strategy.
virtual int32_t GetWeight() const =0
Get static base weight assigned to the task.
virtual ITask * GetUserTask()=0
Get user task.
Interface for a platform driver.
Definition stk_common.h:575
virtual void ProcessTick()=0
Process one tick.
virtual Word GetCallerSP() const =0
Get caller's Stack Pointer (SP).
virtual TId GetTid() const =0
Get thread Id.
virtual bool InitStack(EStackType stack_type, Stack *stack, IStackMemory *stack_memory, ITask *user_task)=0
Initialize stack memory of the user task.
virtual void Initialize(IEventHandler *event_handler, IKernelService *service, uint32_t resolution_us, Stack *exit_trap)=0
Initialize scheduler's context.
virtual void Start()=0
Start scheduling.
virtual void Stop()=0
Stop scheduling.
virtual void SwitchToNext()=0
Switch to a next task.
virtual void Sleep(Timeout ticks)=0
Put calling process into a sleep state.
virtual void SleepUntil(Ticks timestamp)=0
Put calling process into a sleep state until the specified timestamp.
virtual void SetEventOverrider(IEventOverrider *overrider)=0
Set platform event overrider.
virtual uint32_t GetTickResolution() const =0
Get resolution of the system tick timer in microseconds. Resolution means a number of microseconds be...
virtual void ProcessHardFault()=0
Cause a hard fault of the system.
Interface for a back-end event handler.
Definition stk_common.h:583
virtual void OnTaskExit(Stack *stack)=0
Called from the Thread process when task finished (its Run function exited by return).
virtual bool OnTick(Stack *&idle, Stack *&active)=0
Called by ISR handler to notify about the next system tick.
virtual void OnStart(Stack *&active)=0
Called by ISR handler to notify that scheduling is about to start.
virtual TId OnGetTid(Word caller_SP)=0
Called from the Thread process when for getting task/thread id of the process.
virtual void OnTaskSleepUntil(Word caller_SP, Ticks timestamp)=0
Called by Thread process (via IKernelService::SleepUntil) for exclusion of the calling process from s...
virtual IWaitObject * OnTaskWait(Word caller_SP, ISyncObject *sync_obj, IMutex *mutex, Timeout timeout)=0
Called from the Thread process when task needs to wait.
virtual void OnStop()=0
Called by driver to notify that scheduling is stopped.
virtual void OnTaskSleep(Word caller_SP, Timeout ticks)=0
Called by Thread process (via IKernelService::Sleep) for exclusion of the calling process from schedu...
virtual void OnTaskSwitch(Word caller_SP)=0
Called by Thread process (via IKernelService::SwitchToNext) to switch to a next task.
Interface for a platform event overrider.
Definition stk_common.h:659
virtual bool OnHardFault()=0
Called by Kernel when hard fault happens.
virtual bool OnSleep()=0
Called by Kernel when its entering a sleep mode.
Interface for a task switching strategy implementation.
Definition stk_common.h:782
virtual void RemoveTask(IKernelTask *task)=0
Remove task.
virtual void OnTaskSleep(IKernelTask *task)=0
Notification that a task has entered sleep/blocked state.
virtual void OnTaskWake(IKernelTask *task)=0
Notification that a task is becoming runnable again.
virtual size_t GetSize() const =0
Get number of tasks currently managed by this strategy.
virtual IKernelTask * GetNext()=0
Advance the internal iterator and return the next runnable task.
virtual IKernelTask * GetFirst() const =0
Get first task.
virtual void AddTask(IKernelTask *task)=0
Add task.
virtual bool OnTaskDeadlineMissed(IKernelTask *task)=0
Notification that a task has exceeded its HRT deadline; returns whether the strategy can recover with...
Interface for the implementation of the kernel of the scheduler. It supports Soft and Hard Real-Time ...
Definition stk_common.h:854
EState
Kernel state.
Definition stk_common.h:860
@ STATE_INACTIVE
not ready, IKernel::Initialize() must be called
Definition stk_common.h:861
@ STATE_READY
ready to start, IKernel::Start() must be called
Definition stk_common.h:862
@ STATE_RUNNING
initialized and running, IKernel::Start() was called successfully
Definition stk_common.h:863
virtual IPlatform * GetPlatform()=0
Get platform driver instance.
virtual EState GetState() const =0
Get a snapshot of the kernel state.
virtual void RemoveTask(ITask *user_task)=0
Remove user task.
virtual void AddTask(ITask *user_task)=0
Add user task.
virtual void Initialize(uint32_t resolution_us=PERIODICITY_DEFAULT)=0
Initialize kernel.
virtual ITaskSwitchStrategy * GetSwitchStrategy()=0
Get switch strategy instance.
virtual void Start()=0
Start kernel scheduling.
virtual void AddTask(ITask *user_task, Timeout periodicity_tc, Timeout deadline_tc, Timeout start_delay_tc)=0
Add user task.
Interface for the kernel services exposed to the user processes during run-time when Kernel started s...
Definition stk_common.h:929
virtual TId GetTid() const =0
Get thread Id of the currently running task.
static IKernelService * GetInstance()
Get CPU-local instance of the kernel service.
Definition stktest.cpp:69
virtual Ticks GetTicks() const =0
Get number of ticks elapsed since kernel start.
virtual void SwitchToNext()=0
Notify scheduler to switch to the next task (yield).
virtual void Sleep(Timeout ticks)=0
Put calling process into a sleep state.
virtual void SleepUntil(Ticks timestamp)=0
Put calling process into a sleep state until the specified timestamp.
virtual IWaitObject * Wait(ISyncObject *sobj, IMutex *mutex, Timeout timeout)=0
Put calling process into a waiting state until synchronization object is signaled or timeout occurs.
virtual int32_t GetTickResolution() const =0
Get number of microseconds in one tick.
virtual void Delay(Timeout ticks)=0
Delay calling process.
Intrusive doubly-linked list node. Embed this as a base class in any object (T) that needs to partici...
DLHeadType * GetHead() const
Get the list head this entry currently belongs to.
DListHead< IWaitObject, _ClosedLoop > DLHeadType
DListEntry< IWaitObject, _ClosedLoop > DLEntryType