Tkrzw
Classes | Public Member Functions | Friends | List of all members
tkrzw::SignalBroker Class Referencefinal

Broker to send a signal to another thread. More...

#include <tkrzw_thread_util.h>

Classes

class  Waiter
 Handler to wait for the signal. More...
 

Public Member Functions

 SignalBroker ()
 Default constructor. More...
 
bool Send (bool all=true)
 Sends a signal identified by a key. More...
 

Friends

class Waiter
 

Detailed Description

Broker to send a signal to another thread.

Constructor & Destructor Documentation

◆ SignalBroker()

tkrzw::SignalBroker::SignalBroker ( )

Default constructor.

Member Function Documentation

◆ Send()

bool tkrzw::SignalBroker::Send ( bool  all = true)

Sends a signal identified by a key.

Parameters
allIf true, notification is sent to all waiting threads. If false, it is sent to only one waiting thread.
Returns
True if the signal is received by an waiting thread, or false if not.