Mark3 Realtime Kernel
Mark3::Notify Class Reference

The Notify class. This class provides a blocking object type that allows one or more threads to wait for an event to occur before resuming operation. More...

#include <notify.h>

Inheritance diagram for Mark3::Notify:
Mark3::BlockingObject

Public Member Functions

void * operator new (size_t sz, void *pv)
 
 ~Notify ()
 
void Init (void)
 Init Initialze the Notification object prior to use. More...
 
void Signal (void)
 Signal Signal the notification object. This will cause the highest priority thread currently blocking on the object to wake. If no threads are currently blocked on the object, the call has no effect. More...
 
void Wait (bool *pbFlag_)
 Wait Block the current thread, waiting for a signal on the object. More...
 
bool Wait (uint32_t u32WaitTimeMS_, bool *pbFlag_)
 Wait Block the current thread, waiting for a signal on the object. More...
 
void WakeMe (Thread *pclChosenOne_)
 WakeMe Wake the specified thread from its current blocking queue. Note that this is only public in order to be accessible from a timer callack. More...
 
- Public Member Functions inherited from Mark3::BlockingObject
 BlockingObject ()
 
 ~BlockingObject ()
 

Private Attributes

bool m_bPending
 

Additional Inherited Members

- Protected Member Functions inherited from Mark3::BlockingObject
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...
 
- Protected Attributes inherited from Mark3::BlockingObject
ThreadList m_clBlockList
 
uint8_t m_u8Initialized
 
- Static Protected Attributes inherited from Mark3::BlockingObject
static constexpr auto m_uBlockingInvalidCookie = uint8_t { 0x3C }
 
static constexpr auto m_uBlockingInitCookie = uint8_t { 0xC3 }
 

Detailed Description

The Notify class. This class provides a blocking object type that allows one or more threads to wait for an event to occur before resuming operation.

Examples:
lab10_notifications/main.cpp.

Definition at line 33 of file notify.h.

Constructor & Destructor Documentation

◆ ~Notify()

Mark3::Notify::~Notify ( )

Definition at line 47 of file notify.cpp.

Member Function Documentation

◆ Init()

void Mark3::Notify::Init ( void  )

Init Initialze the Notification object prior to use.

Definition at line 57 of file notify.cpp.

◆ operator new()

void* Mark3::Notify::operator new ( size_t  sz,
void *  pv 
)
inline

Definition at line 36 of file notify.h.

◆ Signal()

void Mark3::Notify::Signal ( void  )

Signal Signal the notification object. This will cause the highest priority thread currently blocking on the object to wake. If no threads are currently blocked on the object, the call has no effect.

Examples:
lab10_notifications/main.cpp.

Definition at line 66 of file notify.cpp.

◆ Wait() [1/2]

void Mark3::Notify::Wait ( bool *  pbFlag_)

Wait Block the current thread, waiting for a signal on the object.

Parameters
pbFlag_Flag set to false on block, and true upon wakeup.
Examples:
lab10_notifications/main.cpp.

Definition at line 95 of file notify.cpp.

◆ Wait() [2/2]

bool Mark3::Notify::Wait ( uint32_t  u32WaitTimeMS_,
bool *  pbFlag_ 
)

Wait Block the current thread, waiting for a signal on the object.

Parameters
u32WaitTimeMS_Time to wait for the notification event.
pbFlag_Flag set to false on block, and true upon wakeup.
Returns
true on notification, false on timeout

Definition at line 125 of file notify.cpp.

◆ WakeMe()

void Mark3::Notify::WakeMe ( Thread pclChosenOne_)

WakeMe Wake the specified thread from its current blocking queue. Note that this is only public in order to be accessible from a timer callack.

Parameters
pclChosenOne_Thread to wake up

Definition at line 175 of file notify.cpp.

Member Data Documentation

◆ m_bPending

bool Mark3::Notify::m_bPending
private

Definition at line 89 of file notify.h.


The documentation for this class was generated from the following files: