Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
SyncNotifiable Class Reference

A Notifiable for synchronously waiting for a notification. More...

#include <Notifiable.hxx>

Inheritance diagram for SyncNotifiable:
Notifiable Destructable ExecutorGuard

Public Member Functions

 SyncNotifiable ()
 Constructor.
 
void notify () override
 Implementation of notification receive.
 
void wait_for_notification ()
 Blocks the current thread until the notification is delivered.
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (SyncNotifiable)
 

Private Attributes

OSSem sem_
 Semaphore helping the implementation.
 

Detailed Description

A Notifiable for synchronously waiting for a notification.

TODO(balazs.racz): We should make a syncnotifiable not need a semaphore of itself, but rather use a thread-local semaphore.

Definition at line 60 of file Notifiable.hxx.

Constructor & Destructor Documentation

◆ SyncNotifiable()

SyncNotifiable::SyncNotifiable ( )
inline

Constructor.

Definition at line 64 of file Notifiable.hxx.

Member Function Documentation

◆ notify()

void SyncNotifiable::notify ( )
inlineoverridevirtual

Implementation of notification receive.

Implements Notifiable.

Definition at line 69 of file Notifiable.hxx.

◆ wait_for_notification()

void SyncNotifiable::wait_for_notification ( )
inline

Blocks the current thread until the notification is delivered.

Definition at line 85 of file Notifiable.hxx.

Member Data Documentation

◆ sem_

OSSem SyncNotifiable::sem_
private

Semaphore helping the implementation.

Definition at line 92 of file Notifiable.hxx.


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