YARP  2.3.70.2
Yet Another Robot Platform
yarp::os::Mutex Class Reference

Basic wrapper for mutual exclusion. More...

#include <yarp/os/Mutex.h>

Public Member Functions

 Mutex ()
 Constructor. More...
 
 ~Mutex ()
 Destructor. More...
 
void lock ()
 Lock the associated resource, waiting if necessary. More...
 
bool tryLock ()
 Lock the associated resource if possible. More...
 
void unlock ()
 Unlock the associated resource. More...
 

Private Attributes

void * implementation
 

Detailed Description

Basic wrapper for mutual exclusion.

Intended to match std::mutex in C++11, for eventual replacement by that class.

Definition at line 25 of file Mutex.h.

Constructor & Destructor Documentation

◆ Mutex()

Mutex::Mutex ( )

Constructor.

Definition at line 15 of file Mutex.cpp.

◆ ~Mutex()

Mutex::~Mutex ( )

Destructor.

Definition at line 22 of file Mutex.cpp.

Member Function Documentation

◆ lock()

void Mutex::lock ( )

Lock the associated resource, waiting if necessary.

Behavior is undefined if called by the thread currently locking the resource.

Definition at line 29 of file Mutex.cpp.

◆ tryLock()

bool Mutex::tryLock ( )

Lock the associated resource if possible.

Don't wait. Behavior is undefined if called by the thread currently locking the resource.

Returns
true if the associated resource was successfully locked.

Definition at line 33 of file Mutex.cpp.

◆ unlock()

void Mutex::unlock ( )

Unlock the associated resource.

If the resource is not currently locked by the calling thread, the behavior is undefined.

Definition at line 37 of file Mutex.cpp.

Member Data Documentation

◆ implementation

void* yarp::os::Mutex::implementation
private

Definition at line 71 of file Mutex.h.


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