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

#include <Readiness.h>

+ Inheritance diagram for ReadinessSource:
+ Collaboration diagram for ReadinessSource:

Public Member Functions

MUST_USE_RESULT bool subscribeReadiness (ReadyMask interest, const SharedPointer< ReadinessObserver > &observer, ReadinessSubscription &subscription)
 
virtual ReadinessGenerations readinessGenerations ()
 

Protected Member Functions

void notifyReadiness (ReadyMask mask)
 
void closeReadiness (ReadyMask mask=ReadyInvalid|ReadyHangup)
 

Private Member Functions

 ReadinessSource (const ReadinessSource &)=delete
 
ReadinessSourceoperator= (const ReadinessSource &)=delete
 

Private Attributes

SharedPointer< ReadinessStatem_ReadinessState
 

Detailed Description

A lifetime-safe registry for mask-filtered readiness notifications.

Definition at line 86 of file Readiness.h.

Constructor & Destructor Documentation

◆ ReadinessSource()

ReadinessSource::ReadinessSource ( )

Definition at line 171 of file Readiness.cc.

◆ ~ReadinessSource()

ReadinessSource::~ReadinessSource ( )
virtual

Definition at line 173 of file Readiness.cc.

Member Function Documentation

◆ closeReadiness()

void ReadinessSource::closeReadiness ( ReadyMask  mask = ReadyInvalid | ReadyHangup)
protected

Reject future subscriptions and issue one final terminal notification.

Definition at line 208 of file Readiness.cc.

Referenced by NetworkSyscalls::lastDescriptorClosed(), LwipSocketSyscalls::lastDescriptorClosed(), MqueueNetlinkSocket::lastDescriptorClosed(), and File::~File().

+ Here is the caller graph for this function:

◆ notifyReadiness()

void ReadinessSource::notifyReadiness ( ReadyMask  mask)
protected

Notify interested observers that the supplied predicates may have changed.

Definition at line 201 of file Readiness.cc.

Referenced by UnixSocketSyscalls::bind(), UnixSocketSyscalls::connect(), File::dataChanged(), InotifyInstance::eventsQueued(), LwipSocketSyscalls::netconnCallback(), UnixSocketSyscalls::pairWith(), EventFd::readValue(), and EventFd::writeValue().

+ Here is the caller graph for this function:

◆ readinessGenerations()

ReadinessGenerations ReadinessSource::readinessGenerations ( )
virtual

Return source-serialized rising-edge sequences where available.

A source increments the corresponding sequence while holding the same lock which changes its readiness predicate. Consumers can then recover a drain/refill transition even if the two callback deliveries are reordered.

Reimplemented in EventFd, FanotifyQueue, InotifyInstance, MqueueNetlinkSocket, PosixMessageQueue, NetworkSyscalls, LwipSocketSyscalls, UnixSocketSyscalls, SignalFdView, TimerFd, UnixSocket, ConsoleFile, and Pipe.

Definition at line 177 of file Readiness.cc.

Referenced by EpollInstance::control().

+ Here is the caller graph for this function:

◆ subscribeReadiness()

bool ReadinessSource::subscribeReadiness ( ReadyMask  interest,
const SharedPointer< ReadinessObserver > &  observer,
ReadinessSubscription subscription 
)

Registers an observer. Callers must query the source after this returns to close the snapshot-versus-registration race; duplicate wakeups are valid.

Definition at line 181 of file Readiness.cc.

References SharedPointer< T >::get().

Referenced by EpollInstance::control().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ReadinessState

SharedPointer<ReadinessState> ReadinessSource::m_ReadinessState
private

Definition at line 119 of file Readiness.h.


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