AXCEL C++ Framework
Elegance through abstraction
Public Member Functions | Public Attributes
axcel::proc::mutex Class Reference

Mutex. More...

#include <axcel.h>

Inheritance diagram for axcel::proc::mutex:
axcel::object

List of all members.

Public Member Functions

virtual string type ()
 Get type of object.
virtual operator string ()
 Convert to string.
 mutex ()
 ~mutex ()
void lock ()
bool trylock ()
void unlock ()

Public Attributes

pthread_mutex_t id

Detailed Description

Mutex.

Mutexes allow process and threads to access shared resources one at a time. What happens when 2 threads try to access a global variable at the same time!? A mutex is like a thread-safe boolean... not really. When a thread wants to access a shared resource, it will lock a mutex, then when it's done with the resource it will unlock the mutex. If a thread tries to lock an already locked mutex, then it will block until it becomes unlocked.

Definition at line 2063 of file axcel.h.


Constructor & Destructor Documentation

axcel::proc::mutex::mutex ( )

Definition at line 6553 of file axcel.cpp.

axcel::proc::mutex::~mutex ( )

Definition at line 6554 of file axcel.cpp.


Member Function Documentation

void axcel::proc::mutex::lock ( )

Definition at line 6555 of file axcel.cpp.

axcel::proc::mutex::operator string ( ) [virtual]

Convert to string.

Returns:
Suitable string representation of object's data

Implements axcel::object.

Definition at line 290 of file axcel.cpp.

bool axcel::proc::mutex::trylock ( )

Definition at line 6556 of file axcel.cpp.

string axcel::proc::mutex::type ( ) [virtual]

Get type of object.

Returns:
string containing name of object's class.

Implements axcel::object.

Definition at line 265 of file axcel.cpp.

void axcel::proc::mutex::unlock ( )

Definition at line 6557 of file axcel.cpp.


Member Data Documentation

pthread_mutex_t axcel::proc::mutex::id

Definition at line 2070 of file axcel.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Defines