Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::Mutex::Lock Class Reference

Locking class for easy locking and unlocking by destructor. More...

#include <Mutex.h>

Inheritance diagram for sf::Mutex::Lock:
[legend]

Public Member Functions

 Lock (const Mutex &mutex, bool try_lock=false)
 Constructor.
 ~Lock ()
 Destructor.
bool acquire (bool try_lock=false, const TimeSpec &timeout={})
 Returns true when if it was acquired.
bool release ()
 operator bool () const
 Returns true if the class was locked. Always true when try_lock is false.

Detailed Description

Locking class for easy locking and unlocking by destructor.

Constructor & Destructor Documentation

◆ Lock()

sf::Mutex::Lock::Lock ( const Mutex & mutex,
bool try_lock = false )
explicit

Constructor.

◆ ~Lock()

sf::Mutex::Lock::~Lock ( )

Destructor.

Member Function Documentation

◆ acquire()

bool sf::Mutex::Lock::acquire ( bool try_lock = false,
const TimeSpec & timeout = {} )

Returns true when if it was acquired.

◆ operator bool()

sf::Mutex::Lock::operator bool ( ) const
inlineexplicit

Returns true if the class was locked. Always true when try_lock is false.

◆ release()

bool sf::Mutex::Lock::release ( )

Releases the mutex.

Returns
True if actually released.

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