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

#include <named_recursive_mutex.hpp>

Public Member Functions

 shm_named_recursive_mutex (create_only_t create_only, const char *name, const permissions &perm=permissions())
 Creates a global recursive_mutex with a name. More...
 
 shm_named_recursive_mutex (open_or_create_t open_or_create, const char *name, const permissions &perm=permissions())
 Opens or creates a global recursive_mutex with a name. More...
 
 shm_named_recursive_mutex (open_only_t open_only, const char *name)
 Opens a global recursive_mutex with a name if that recursive_mutex is previously created. More...
 
 ~shm_named_recursive_mutex ()
 Destroys *this and indicates that the calling process is finished using the resource. More...
 
void unlock ()
 Unlocks a previously locked shm_named_recursive_mutex. More...
 
void lock ()
 Locks shm_named_recursive_mutex, sleeps when shm_named_recursive_mutex is already locked. More...
 
bool try_lock ()
 Tries to lock the shm_named_recursive_mutex, returns false when shm_named_recursive_mutex is already locked, returns true when success. More...
 
bool timed_lock (const boost::posix_time::ptime &abs_time)
 Tries to lock the shm_named_recursive_mutex until time abs_time, Returns false when timeout expires, returns true when locks. More...
 

Static Public Member Functions

static bool remove (const char *name)
 Erases a named recursive mutex from the system. More...
 

Friends

class interprocess_tester
 

Constructor & Destructor Documentation

boost::interprocess::ipcdetail::shm_named_recursive_mutex::shm_named_recursive_mutex ( create_only_t  create_only,
const char *  name,
const permissions perm = permissions() 
)
inline

Creates a global recursive_mutex with a name.

If the recursive_mutex can't be created throws interprocess_exception

boost::interprocess::ipcdetail::shm_named_recursive_mutex::shm_named_recursive_mutex ( open_or_create_t  open_or_create,
const char *  name,
const permissions perm = permissions() 
)
inline

Opens or creates a global recursive_mutex with a name.

If the recursive_mutex is created, this call is equivalent to shm_named_recursive_mutex(create_only_t, ... ) If the recursive_mutex is already created, this call is equivalent shm_named_recursive_mutex(open_only_t, ... ) Does not throw

boost::interprocess::ipcdetail::shm_named_recursive_mutex::shm_named_recursive_mutex ( open_only_t  open_only,
const char *  name 
)
inline

Opens a global recursive_mutex with a name if that recursive_mutex is previously created.

If it is not previously created this function throws interprocess_exception.

boost::interprocess::ipcdetail::shm_named_recursive_mutex::~shm_named_recursive_mutex ( )
inline

Destroys *this and indicates that the calling process is finished using the resource.

The destructor function will deallocate any system resources allocated by the system for use by this process for this resource. The resource can still be opened again calling the open constructor overload. To erase the resource from the system use remove().

Member Function Documentation

void boost::interprocess::ipcdetail::shm_named_recursive_mutex::lock ( )
inline

Locks shm_named_recursive_mutex, sleeps when shm_named_recursive_mutex is already locked.

Throws interprocess_exception if a severe error is found.

References boost::mutex::lock().

Referenced by boost::interprocess::named_recursive_mutex::lock().

bool boost::interprocess::ipcdetail::shm_named_recursive_mutex::remove ( const char *  name)
inlinestatic

Erases a named recursive mutex from the system.

References boost::interprocess::shared_memory_object::remove().

Referenced by boost::interprocess::named_recursive_mutex::remove().

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

Tries to lock the shm_named_recursive_mutex until time abs_time, Returns false when timeout expires, returns true when locks.

Throws interprocess_exception if a severe error is found

Referenced by boost::interprocess::named_recursive_mutex::timed_lock().

bool boost::interprocess::ipcdetail::shm_named_recursive_mutex::try_lock ( )
inline

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

Throws interprocess_exception if a severe error is found.

References boost::mutex::try_lock().

Referenced by boost::interprocess::named_recursive_mutex::try_lock().

void boost::interprocess::ipcdetail::shm_named_recursive_mutex::unlock ( )
inline

Friends And Related Function Documentation

friend class interprocess_tester
friend

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