CallbackWaitLock Class Reference

CallbackWaitLock is used to block a thread and unblock it from another thread via callback. More...

#include <ArmarXCore/core/time/CallbackWaitLock.h>

+ Inheritance diagram for CallbackWaitLock:

Public Member Functions

void call () override
 
 CallbackWaitLock ()
 
void wait ()
 wait blocks the calling thread until CallbackWaitLock::call() is called. More...
 
- Public Member Functions inherited from CallbackReceiver
virtual ~CallbackReceiver ()
 

Protected Attributes

bool called
 whether call() was called (to prevent race conditions) More...
 
std::condition_variable condWait
 
std::mutex waitMutex
 

Detailed Description

CallbackWaitLock is used to block a thread and unblock it from another thread via callback.

When wait() is called, the calling thread is blocked until call() is called from another thread. This is mainly intended as helper for TimeUtil::Sleep(,,,).

Definition at line 42 of file CallbackWaitLock.h.

Constructor & Destructor Documentation

◆ CallbackWaitLock()

Definition at line 29 of file CallbackWaitLock.cpp.

Member Function Documentation

◆ call()

void call ( )
overridevirtual

Implements CallbackReceiver.

Definition at line 40 of file CallbackWaitLock.cpp.

◆ wait()

void wait ( )

wait blocks the calling thread until CallbackWaitLock::call() is called.

Definition at line 31 of file CallbackWaitLock.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ called

bool called
protected

whether call() was called (to prevent race conditions)

Definition at line 61 of file CallbackWaitLock.h.

◆ condWait

std::condition_variable condWait
protected

Definition at line 56 of file CallbackWaitLock.h.

◆ waitMutex

std::mutex waitMutex
protected

Definition at line 57 of file CallbackWaitLock.h.


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