The Pedigree Project 0.1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
BufferMonitors Class Reference

#include <BufferMonitors.h>

+ Collaboration diagram for BufferMonitors:

Classes

struct  MonitorTarget
 

Public Member Functions

bool add (Thread *thread, Event *event)
 
void add (Semaphore *semaphore)
 
void notify ()
 
void clear ()
 
void cull (Thread *thread)
 
void cull (Semaphore *semaphore)
 
void cull (Event *event)
 

Private Member Functions

 NOT_COPYABLE_OR_ASSIGNABLE (BufferMonitors)
 

Private Attributes

List< MonitorTarget * > m_Targets
 

Detailed Description

One-shot buffer readiness subscriptions. The caller serializes registration, notification and removal with the mutex protecting its buffer state.

Definition at line 22 of file BufferMonitors.h.

Constructor & Destructor Documentation

◆ BufferMonitors()

BufferMonitors::BufferMonitors ( )

Definition at line 36 of file BufferMonitors.cc.

◆ ~BufferMonitors()

BufferMonitors::~BufferMonitors ( )

Definition at line 38 of file BufferMonitors.cc.

Member Function Documentation

◆ add() [1/2]

void BufferMonitors::add ( Semaphore *  semaphore)

Definition at line 52 of file BufferMonitors.cc.

◆ add() [2/2]

bool BufferMonitors::add ( Thread *  thread,
Event *  event 
)

Returns false if the Event has closed registration admission.

Definition at line 42 of file BufferMonitors.cc.

References Event::tryAcquireRegistration().

◆ clear()

void BufferMonitors::clear ( )

Wakes semaphore waiters but retires Event registrations without delivery.

Definition at line 70 of file BufferMonitors.cc.

References Semaphore::release().

◆ cull() [1/3]

void BufferMonitors::cull ( Event *  event)

Definition at line 106 of file BufferMonitors.cc.

◆ cull() [2/3]

void BufferMonitors::cull ( Semaphore *  semaphore)

Definition at line 94 of file BufferMonitors.cc.

◆ cull() [3/3]

void BufferMonitors::cull ( Thread *  thread)

Definition at line 82 of file BufferMonitors.cc.

◆ notify()

void BufferMonitors::notify ( )

Delivers every subscription and releases its registration.

Definition at line 56 of file BufferMonitors.cc.

References Semaphore::release(), and Thread::sendEvent().

Member Data Documentation

◆ m_Targets

List<MonitorTarget*> BufferMonitors::m_Targets
private

Definition at line 45 of file BufferMonitors.h.


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