FRIBParallelanalysis
1.0
FrameworkforMPIParalleldataanalysisatFRIB
|
#include <CTCLMutex.h>
Public Member Functions | |
CMutexAttr () | |
~CMutexAttr () | |
void | setShared () |
void | setUnshared () |
bool | isShareable () |
void | setType (int type) |
int | getType () |
Static Public Member Functions | |
static void | throwifbad (int status, const char *message) |
Public Attributes | |
pthread_mutexattr_t | m_attributes |
Direct encapsulation of a pthread mutex attribute block. We only support the attributes in the base pthreads specification (not the realtime nor the advanced realtime specs), as you should be able to count on those always being available
CMutexAttr::CMutexAttr | ( | ) |
Construct a CMutexAttr&. The member is just initialized and CErrnoException thrown if there was an error:
CMutexAttr::~CMutexAttr | ( | ) |
Destruction just destroys the attribute block, reporting a CErrnoException if there's an error:
int CMutexAttr::getType | ( | ) |
one | of the mutex type codes above. |
bool CMutexAttr::isShareable | ( | ) |
Get the state of the shared flag
true | - mutex can be used to synchronize processes. |
false | - Mutex can only be used within the process. |
void CMutexAttr::setShared | ( | ) |
Set the attributes block for a sharable resource. Shared mutexes can be created in shared memory and used for inter-process synchronization.
void CMutexAttr::setType | ( | int | type | ) |
Sets the mutex type:
type | - an integer code that can be one of:
|
void CMutexAttr::setUnshared | ( | ) |
Set the mutex attributes to process private. The mutex can only synchronize threads in the creating process.