Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

at::Mutex Class Reference

#include <at_thread.h>

Inheritance diagram for at::Mutex:

Inheritance graph
[legend]
Collaboration diagram for at::Mutex:

Collaboration graph
[legend]
List of all members.

Public Types

enum  MutexType { NonRecursive, Recursive, Checking }

Public Methods

 Mutex (MutexType i_type=NonRecursive)
 ~Mutex ()
void Lock ()
bool TryLock ()
void Unlock ()

Friends

class Conditional

Detailed Description

Mutex is a "mutual exclusion" lock. The goal here is that the Mutex is able to be constructed anywhere, hopefully not requiring an allocation of memory.


Member Enumeration Documentation

enum at::Mutex::MutexType
 

A Mutex may behave in different ways depending on type.

Enumeration values:
NonRecursive  NonRecursive is a "fast" lock. It does not allow one thread to attain the mutex more than once.
Recursive  Recursive allows the process that attains a lock to lock more than once.
Checking  Checking is an error checking lock.


Constructor & Destructor Documentation

at::Mutex::Mutex MutexType    i_type = NonRecursive
 

Mutex constructor initialized the m_mutex_context for this object based on the mutex type.

at::Mutex::~Mutex  
 

Mutex destructor.


Member Function Documentation

void at::Mutex::Lock  
 

Lock will wait indefinitely to attain the lock.

Parameters:
i_X 
Returns:
nothing

bool at::Mutex::TryLock  
 

TryLock will attempt to attain the mutex. If mutex is currently taken, TryLock will return immediatly with a "false" return value, otherwise it will attain the lock and return true.

Returns:
true when lock is taked, false otherwise.

void at::Mutex::Unlock  
 

Unlock will release the lock. It is an error to call unlock if the calling thread has not previously taken the lock.

Returns:
nothing


Friends And Related Function Documentation

friend class Conditional [friend]
 


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

Generated for Austria by doxygen and MakeXS at Sun Oct 24 17:35:34 PDT 2004