S3FC project page | S3FC home page |
pthread_mutex_t
.
More...
#include <s3_mutex.h>
Public Methods | |
s3_mutex () | |
Default constructor: instantiate a new mutex. More... | |
~s3_mutex () | |
Destructor: destroy the mutex primitive. More... | |
void | lock () const |
Attempt to lock the mutex. More... | |
bool | try_lock () const |
Attempt to lock the mutex, but immediately return a false if it is already locked. More... | |
void | unlock () const |
Unlock the mutex (please read note about unlocking in s3_mutex class documentation.. More... | |
Protected Methods | |
s3_mutex (const s3_mutex &src) | |
Copy constructor: private for your convenience (thou shalt not copy construct an s3_mutex - deal with it). More... | |
s3_mutex & | operator= (const s3_mutex &src) |
Neither shalt thou copy assign an s3_mutex . More... | |
Protected Attributes | |
pthread_mutex_t | mutex |
LinuxThreads mutex primitive. More... | |
Friends | |
class | s3_condition |
pthread_mutex_t
.
Note: only the fast
mutex kind is implemented.
A mutex is a primitive that is either in a locked
or unlocked
state and is always owned by a single process when it is locked. Otherwise it is not owned. The following operations are supported (assumes a fast
mutex):
Note: The following rules must be obeyed when calling unlock:
const
context.
Definition at line 75 of file s3_mutex.h.
|
Default constructor: instantiate a new mutex.
Definition at line 44 of file s3_mutex.cc. References CONST_OVERRIDE_MUTEX_T, and mutex. |
|
Destructor: destroy the mutex primitive.
Definition at line 51 of file s3_mutex.cc. References CONST_OVERRIDE_MUTEX_T, mutex, and unlock. |
|
Copy constructor: private for your convenience (thou shalt not copy construct an
Definition at line 63 of file s3_mutex.cc. |
|
|
Neither shalt thou copy assign an
Definition at line 70 of file s3_mutex.cc. |
|
Attempt to lock the mutex, but immediately return a
If it is unlocked, it is locked as if
Definition at line 87 of file s3_mutex.cc. References CONST_OVERRIDE_MUTEX_T, and mutex. Referenced by s3_thread_base::test_state. |
|
|
Definition at line 78 of file s3_mutex.h. |
|
LinuxThreads mutex primitive.
Definition at line 83 of file s3_mutex.h. Referenced by lock, s3_mutex, try_lock, unlock, s3_condition::wait, and ~s3_mutex. |
Send comments to: s3fc@stonethree.com |
|