10#ifndef STK_SYNC_EVENT_H_
11#define STK_SYNC_EVENT_H_
69 explicit Event(
bool manual_reset =
false,
bool initial_state =
false)
155 __stk_full_memfence();
176 __stk_full_memfence();
194 __stk_full_memfence();
206 __stk_full_memfence();
225 __stk_full_memfence();
252 __stk_full_memfence();
275 __stk_full_memfence();
#define STK_ASSERT(e)
Runtime assertion. Halts execution if the expression e evaluates to false.
Implementation of synchronization primitive: stk::sync::ScopedCriticalSection.
Namespace of STK package.
const Timeout WAIT_INFINITE
Timeout value: block indefinitely until the synchronization object is signaled.
int32_t Timeout
Timeout time (ticks).
const Timeout NO_WAIT
Timeout value: return immediately if the synchronization object is not yet signaled (non-blocking pol...
bool IsInsideISR()
Check whether the CPU is currently executing inside a hardware interrupt service routine (ISR).
Synchronization primitives for task coordination and resource protection.
virtual bool IsTimeout() const =0
Check if task woke up due to a timeout.
IWaitObject::ListHeadType m_wait_list
tasks blocked on this object
void WakeOne()
Wake the first task in the wait list (FIFO order).
ISyncObject()
Constructor.
void WakeAll()
Wake all tasks currently in the wait list.
virtual void RemoveWaitObject(IWaitObject *wobj)
Called by kernel when a waiting task is being removed (timeout expired, wait aborted,...
static IKernelService * GetInstance()
Get CPU-local instance of the kernel service.
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.
RAII-style low-level synchronization primitive for atomic code execution. Used as building brick for ...
bool Set()
Set event to signaled state.
void Pulse()
Pulse event: attempt to release waiters and then reset (Win32 PulseEvent() semantics).
bool TryWait()
Poll event state without blocking.
STK_NONCOPYABLE_CLASS(Event)
bool Reset()
Reset event to non-signaled state.
bool m_signaled
current signaled state of the event
void RemoveWaitObject(IWaitObject *wobj)
Called by kernel when a waiting task is being removed (timeout expired, wait aborted,...
Event(bool manual_reset=false, bool initial_state=false)
Constructor.
bool Wait(Timeout timeout=WAIT_INFINITE)
Wait until event becomes signaled or the timeout expires.
bool m_manual_reset
true = manual-reset event, false = auto-reset