YARP
Yet Another Robot Platform
yarp::os::Event Class Reference

A class for thread synchronization and mutual exclusion. More...

#include <yarp/os/Event.h>

Classes

class  Private
 

Public Member Functions

 Event (bool autoResetAfterWait=true)
 Constructor. More...
 
virtual ~Event ()
 Destructor. More...
 
void wait ()
 Wait for the event to be signaled. More...
 
void signal ()
 Put the event in a signaled state. More...
 
void reset ()
 Put the event in a reset state. More...
 

Detailed Description

A class for thread synchronization and mutual exclusion.

An event can be in a signaled or reset state. Threads can wait for an event to enter a signaled state.

Definition at line 26 of file Event.h.

Constructor & Destructor Documentation

◆ Event()

yarp::os::Event::Event ( bool  autoResetAfterWait = true)

Constructor.

Sets the initial value of the counter.

Parameters
autoResetAfterWaitif set, reset() will be called automatically after wait().

Definition at line 74 of file Event.cpp.

◆ ~Event()

yarp::os::Event::~Event ( )
virtual

Destructor.

Definition at line 79 of file Event.cpp.

Member Function Documentation

◆ reset()

void yarp::os::Event::reset ( )

Put the event in a reset state.

Definition at line 94 of file Event.cpp.

◆ signal()

void yarp::os::Event::signal ( )

Put the event in a signaled state.

A thread wait()ing for the event will wake up. If the event was created with autoResetAfterWait set, then at most one thread will wake up (and then automatically reset the event), otherwise all waiting threads will wake up.

Definition at line 89 of file Event.cpp.

◆ wait()

void yarp::os::Event::wait ( )

Wait for the event to be signaled.

If the event was created with autoResetAfterWait set, then after a wait the event will automatically be reset. That means that any other thread waiting for the same event will not be woken up by the signal that wakes up this call to wait().

Definition at line 84 of file Event.cpp.


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