B2BITS FIX Antenna C++ 2.32.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
System::AutoEvent Class Reference

Syncronization object. More...

#include <B2BITS_AutoEvent.h>

Public Member Functions

 AutoEvent (bool signaled=false)
 Default constructor.
 
void reset ()
 Sets the state of the event to nonsignaled, causing waiting threads to block.
 
void set ()
 Sets the state of the event to signaled, allowing one or more waiting threads to proceed.
 
void wait ()
 Blocks the current thread until event is set to signaled state After method return event is automatically set to nonsignaled state.
 
bool wait (unsigned int msec)
 Blocks the current thread until event is set to signaled state or timeout.
 
virtual ~AutoEvent ()
 Destructor.
 

Protected Attributes

pthread_cond_t cond_
 
pthread_mutex_t mutex_
 
volatile int signaled_
 

Detailed Description

Syncronization object.

Notifies a waiting thread that an event has occurred.

Constructor & Destructor Documentation

◆ AutoEvent()

System::AutoEvent::AutoEvent ( bool signaled = false)
explicit

Default constructor.

◆ ~AutoEvent()

virtual System::AutoEvent::~AutoEvent ( )
virtual

Destructor.

Member Function Documentation

◆ reset()

void System::AutoEvent::reset ( )

Sets the state of the event to nonsignaled, causing waiting threads to block.

◆ set()

void System::AutoEvent::set ( )

Sets the state of the event to signaled, allowing one or more waiting threads to proceed.


◆ wait() [1/2]

void System::AutoEvent::wait ( )

Blocks the current thread until event is set to signaled state After method return event is automatically set to nonsignaled state.

◆ wait() [2/2]

bool System::AutoEvent::wait ( unsigned int msec)

Blocks the current thread until event is set to signaled state or timeout.

If method returns true, event is automatically set to nonsignaled state.

Returns
true if event is set to signaled state; false if time is out.

Member Data Documentation

◆ cond_

pthread_cond_t System::AutoEvent::cond_
protected

◆ mutex_

pthread_mutex_t System::AutoEvent::mutex_
protected

◆ signaled_

volatile int System::AutoEvent::signaled_
protected