fesa-core  7.0.0
fesa::SharedRWLock Class Reference

#include <SharedRWLock.h>

Inheritance diagram for fesa::SharedRWLock:
fesa::RWLock

Static Public Member Functions

static SharedRWLockmap (void *memory, bool initialize)
 
static std::size_t getSize ()
 

Additional Inherited Members

- Public Member Functions inherited from fesa::RWLock
void lockForReading ()
 
void lockForWriting ()
 
void unlock ()
 
void unlock (int nLocksToKeep)
 
bool isReadLockHeld () const
 
bool isWriteLockHeld () const
 
bool isLockHeld () const
 
const RWLockStatus & getLockStatus () const
 
- Protected Member Functions inherited from fesa::RWLock
 RWLock (bool initialize)
 
void checkAlignment () const
 

Detailed Description

Read-write lock that can be shared between threads which don't have the same address space. The first thread shall create it by calling map() with initialize set to true. Additional threads shall map it by calling map() with initialize set to false.

Member Function Documentation

std::size_t fesa::SharedRWLock::getSize ( )
static

Returns the size, in bytes, needed to map a SharedRwLock.

SharedRWLock * fesa::SharedRWLock::map ( void *  memory,
bool  initialize 
)
static

Maps (and optionally initializes) a SharedRWLock on the given address.

Parameters
memorythe address where the SharedRWLock must be mapped. Use getSize() to allocate enough memory.
initializetrue if the read-write lock should be initialized. Only the first thread to map the SharedRwLock should initialize it. The behavior of the SharedRwLock is undefined if more than one thread calls map() with initialize set to true.

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