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

A class that wraps a XSI (System V)-based named semaphore that undoes the operation if the process crashes. More...

#include <xsi_named_mutex.hpp>

Public Member Functions

 xsi_named_mutex ()
 Default constructor. More...
 
 xsi_named_mutex (open_or_create_t, const char *path, boost::uint8_t id, int perm=0666)
 Tries to create a new XSI-based named mutex with a key obtained from a call to ftok (with path "path" and id "id"), and permissions "perm". More...
 
 xsi_named_mutex (BOOST_RV_REF(xsi_named_mutex) moved)
 Moves the ownership of "moved"'s named mutex to *this. More...
 
xsi_named_mutexoperator= (BOOST_RV_REF(xsi_named_mutex) moved)
 Moves the ownership of "moved"'s named mutex to *this. More...
 
void swap (xsi_named_mutex &other)
 Swaps two xsi_named_mutex. Does not throw. More...
 
 ~xsi_named_mutex ()
 Destroys *this. More...
 
const char * get_path () const
 Returns the path used to construct the named mutex. More...
 
int get_permissions () const
 Returns access permissions. More...
 
mapping_handle_t get_mapping_handle () const
 Returns the mapping handle. More...
 
bool remove ()
 Erases a XSI-based named mutex from the system. More...
 
void lock ()
 
void unlock ()
 

Detailed Description

A class that wraps a XSI (System V)-based named semaphore that undoes the operation if the process crashes.

Constructor & Destructor Documentation

boost::interprocess::xsi_named_mutex::xsi_named_mutex ( )
inline

Default constructor.

Represents an empty xsi_named_mutex.

boost::interprocess::xsi_named_mutex::xsi_named_mutex ( open_or_create_t  ,
const char *  path,
boost::uint8_t  id,
int  perm = 0666 
)
inline

Tries to create a new XSI-based named mutex with a key obtained from a call to ftok (with path "path" and id "id"), and permissions "perm".

If the named mutex previously exists, it tries to open it. Otherwise throws an error.

References boost::interprocess::ipcdetail::DoOpenOrCreate.

boost::interprocess::xsi_named_mutex::xsi_named_mutex ( BOOST_RV_REF(xsi_named_mutex moved)
inline

Moves the ownership of "moved"'s named mutex to *this.

After the call, "moved" does not represent any named mutex Does not throw

References swap().

boost::interprocess::xsi_named_mutex::~xsi_named_mutex ( )
inline

Destroys *this.

The named mutex is still valid after destruction. use remove() to destroy the named mutex.

Member Function Documentation

mapping_handle_t boost::interprocess::xsi_named_mutex::get_mapping_handle ( ) const
inline

Returns the mapping handle.

Never throws

const char * boost::interprocess::xsi_named_mutex::get_path ( ) const
inline

Returns the path used to construct the named mutex.

int boost::interprocess::xsi_named_mutex::get_permissions ( ) const
inline

Returns access permissions.

void boost::interprocess::xsi_named_mutex::lock ( void  )
inline
xsi_named_mutex& boost::interprocess::xsi_named_mutex::operator= ( BOOST_RV_REF(xsi_named_mutex moved)
inline

Moves the ownership of "moved"'s named mutex to *this.

After the call, "moved" does not represent any named mutex. Does not throw

References boost::move(), and swap().

bool boost::interprocess::xsi_named_mutex::remove ( )
inline

Erases a XSI-based named mutex from the system.

Returns false on error. Never throws

void boost::interprocess::xsi_named_mutex::swap ( xsi_named_mutex other)
inline

Swaps two xsi_named_mutex. Does not throw.

References boost::swap.

Referenced by operator=(), and xsi_named_mutex().

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

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