fesa-core  4.2.0
fesa::SharedMutex Class Reference

#include <SharedMutex.h>

Inheritance diagram for fesa::SharedMutex:
fesa::Mutex

Static Public Member Functions

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

Additional Inherited Members

- Public Member Functions inherited from fesa::Mutex
void lock () const
 
void unlock () const
 
- Protected Member Functions inherited from fesa::Mutex
 Mutex (bool init)
 
void checkAlignment () const
 

Detailed Description

Mutex 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::SharedMutex::getSize ( )
static

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

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

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

Parameters
memorythe address where the SharedMutex must be mapped. Use getSize() to allocate enough memory.
initializetrue if the mutex should be initialized. Only the first thread to map the SharedMutex should initialize it. The behavior of the SharedMutex 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: