Provided by: libbobcat-dev_3.19.01-1ubuntu1_amd64
FBB::SharedMutex - Mutex for shared memory
#include <bobcat/sharedmutex> Linking option: -lpthread, -lbobcat
Shared memory may be used by multiple processes. To synchronize access to shared memory an FBB::SharedMutex may be defined inside a shared memory segment. An FBB::SharedMutex allows clients to lock a shared memory segment before reading or writing its contents. E.g., the Bobcat class FBB::SharedSegment defines a SharedMutex in its shared memory segment. The FBB::SharedMutex class uses the facilities offered by the PThread library to implement shared memory locking. To force unlocking a (possibly) locked shared memory segment, its destructor can be called.
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.
o SharedMutex(): The default constructor initializes an FBB::SharedMutex object to a shared memory mutex (using the PTHREAD_PROCESS_SHARED attribute). As an FBB::SharedMutex object will normally be defined inside a shared memory segment the object’s memory is already available. In this case placement new should be used to call the constructor. E.g., if a shared memory segment is attached to the current process at d_shared, and an FBB::SharedMutex should be defined at d_shared’s address, then the FBB::SharedMutex object can be initialized like this: new (d_shared) FBB::SharedMutex; The copy and move constructors are not available. The class’s destructor releasea all of the current process’s nested shared memory segment locks. To destroy an FBB::SharedMuted object that has been constructed using the placement new operator use d_sharedMutex->~SharedMutex(); (assuming SharedMutex *d_sharedMutex points to the location where placement new has previously initialized the FBB::SharedMutex object.)
o void lock() const: When returning from this member, the current process has locked the shared memory segment. o void unlock() const: The object’s lock of the shared memory segment is released.
See the sharedstream(3bobcat) man page.
bobcat/sharedmutex - defines the class interface
bobcat(7) isharedstream(3bobcat), osharedstream(3bobcat), sharedblock(3bobcat), sharedmemory(3bobcat), sharedpos(3bobcat), sharedsegment(3bobcat), sharedstream(3bobcat), sharedstreambuf(3bobcat)
o bobcat_3.19.01-x.dsc: detached signature; o bobcat_3.19.01-x.tar.gz: source archive; o bobcat_3.19.01-x_i386.changes: change log; o libbobcat1_3.19.01-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.19.01-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location;
Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.
This is free software, distributed under the terms of the GNU General Public License (GPL).
Frank B. Brokken (email@example.com).