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_mutex & | operator= (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 () |
A class that wraps a XSI (System V)-based named semaphore that undoes the operation if the process crashes.
|
inline |
Default constructor.
Represents an empty xsi_named_mutex.
|
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.
|
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().
|
inline |
Destroys *this.
The named mutex is still valid after destruction. use remove() to destroy the named mutex.
|
inline |
Returns the mapping handle.
Never throws
|
inline |
Returns the path used to construct the named mutex.
|
inline |
Returns access permissions.
|
inline |
|
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().
|
inline |
Erases a XSI-based named mutex from the system.
Returns false on error. Never throws
|
inline |
Swaps two xsi_named_mutex. Does not throw.
References boost::swap.
Referenced by operator=(), and xsi_named_mutex().
|
inline |