INOS
SBusSleeper Struct Reference

#include <cinosbus.h>

Public Types

enum  EReservedCounts { eAlreadySignaled = 0 }
 

Public Member Functions

 SBusSleeper (uint32 auBusTicks, bool abClocked=false)
 

Static Public Member Functions

static void AddSleeper (SBusSleeper &aNewSleeper, SBusSleeper *&apFirstSleeper)
 
static void RemoveSleeper (SBusSleeper &aNewSleeper, SBusSleeper *&apFirstSleeper)
 
static void HandleSleepers (SBusSleeper *&apFirstSleeper)
 

Public Attributes

CINOSSync m_pSync
 
uint32 m_uBusTicks
 
bool m_bClocked
 
SBusSleeperm_pNext
 

Static Public Attributes

static uint64 s_uClockedTickCount
 

Detailed Description

Helper class used to implement the "bus sleep" function. It's used to let an (application) task sleep for a certain amount of bus ticks.

Note
This struct is meant to be only instantiated on the stack. If it must be used in other situations, consider to add DECLARE_DYNAMIC

Member Function Documentation

◆ AddSleeper()

static void SBusSleeper::AddSleeper ( SBusSleeper aNewSleeper,
SBusSleeper *&  apFirstSleeper 
)
static

Helper function to add aNewSleeper to the chained list of sleepers pointed to by apFirstSleeper.

◆ HandleSleepers()

static void SBusSleeper::HandleSleepers ( SBusSleeper *&  apFirstSleeper)
static

Helper function to handler all sleepers in the chained list of sleepers pointed to by apFirstSleeper. "Handled" means that it singals the sync object of every SBusSleeper which count is 1 and sets the remaining count to 'signaled' (= 0) so that it wont be signaled again. If it's bigger than 1, it simply decrements the remaining count.

◆ RemoveSleeper()

static void SBusSleeper::RemoveSleeper ( SBusSleeper aNewSleeper,
SBusSleeper *&  apFirstSleeper 
)
static

Helper function to remove aNewSleeper from the chained list of sleepers pointed to by apFirstSleeper.

Member Data Documentation

◆ m_bClocked

bool SBusSleeper::m_bClocked

Flag determining if the sleeper is of type "clocked".

◆ m_pNext

SBusSleeper* SBusSleeper::m_pNext

Pointer to the next bus sleeper, if any.

◆ m_pSync

CINOSSync SBusSleeper::m_pSync

The sync object on which the application task will be waiting and which will be signaled by the bus task at the right time.

◆ m_uBusTicks

uint32 SBusSleeper::m_uBusTicks

The (remaining) amount of bus ticks until the sync object will be signaled.

◆ s_uClockedTickCount

uint64 SBusSleeper::s_uClockedTickCount
static

Reference counter for clocked bus sleepers.


The documentation for this struct was generated from the following file: