Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::interprocess::interprocess_recursive_mutex Class Reference

Wraps a interprocess_mutex that can be placed in shared memory and can be shared between processes. More...

#include <interprocess_recursive_mutex.hpp>

Public Member Functions

 interprocess_recursive_mutex ()
 Constructor. More...
 
 ~interprocess_recursive_mutex ()
 Destructor. More...
 
void lock ()
 Effects: The calling thread tries to obtain ownership of the mutex, and if another thread has ownership of the mutex, it waits until it can obtain the ownership. More...
 
bool try_lock ()
 Tries to lock the interprocess_mutex, returns false when interprocess_mutex is already locked, returns true when success. More...
 
bool timed_lock (const boost::posix_time::ptime &abs_time)
 Tries to lock the interprocess_mutex, if interprocess_mutex can't be locked before abs_time time, returns false. More...
 
void unlock ()
 Effects: The calling thread releases the exclusive ownership of the mutex. More...
 

Friends

class ipcdetail::robust_emulation_helpers::mutex_traits< interprocess_recursive_mutex >
 

Detailed Description

Wraps a interprocess_mutex that can be placed in shared memory and can be shared between processes.

Allows several locking calls by the same process. Allows timed lock tries

Constructor & Destructor Documentation

boost::interprocess::interprocess_recursive_mutex::interprocess_recursive_mutex ( )
inline

Constructor.

Throws interprocess_exception on error.

boost::interprocess::interprocess_recursive_mutex::~interprocess_recursive_mutex ( )
inline

Destructor.

If any process uses the mutex after the destructor is called the result is undefined. Does not throw.

Member Function Documentation

void boost::interprocess::interprocess_recursive_mutex::lock ( )
inline

Effects: The calling thread tries to obtain ownership of the mutex, and if another thread has ownership of the mutex, it waits until it can obtain the ownership.

If a thread takes ownership of the mutex the mutex must be unlocked by the same mutex. The mutex must be unlocked the same number of times it is locked. Throws: interprocess_exception on error.

References boost::mutex::lock(), and boost::interprocess::timeout_when_locking_error.

bool boost::interprocess::interprocess_recursive_mutex::timed_lock ( const boost::posix_time::ptime abs_time)
inline

Tries to lock the interprocess_mutex, if interprocess_mutex can't be locked before abs_time time, returns false.

The mutex must be unlocked the same number of times it is locked. Throws: interprocess_exception if a severe error is found

bool boost::interprocess::interprocess_recursive_mutex::try_lock ( )
inline

Tries to lock the interprocess_mutex, returns false when interprocess_mutex is already locked, returns true when success.

The mutex must be unlocked the same number of times it is locked. Throws: interprocess_exception if a severe error is found

References boost::mutex::try_lock().

void boost::interprocess::interprocess_recursive_mutex::unlock ( )
inline

Effects: The calling thread releases the exclusive ownership of the mutex.

If the mutex supports recursive locking, the mutex must be unlocked the same number of times it is locked. Throws: interprocess_exception on error.

References boost::mutex::unlock().

Friends And Related Function Documentation


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