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

TNL::Mutex Class Reference

Platform independent Mutual Exclusion implementation. More...

#include <tnlThread.h>

List of all members.

Public Methods

 Mutex ()
 Mutex constructor.

 ~Mutex ()
 Mutex destructor.

void lock ()
 Locks the Mutex.

void unlock ()
 Unlocks the Mutex.

bool tryLock ()
 Attempts to acquire a lock to this Mutex, without blocking.


Detailed Description

Platform independent Mutual Exclusion implementation.

Definition at line 71 of file tnlThread.h.


Member Function Documentation

void TNL::Mutex::lock  
 

Locks the Mutex.

If another thread already has this Mutex locked, this call will block until it is unlocked. If the lock method is called from a thread that has already locked this Mutex, the call will not block and the thread will have to unlock the mutex for as many calls as were made to lock before another thread will be allowed to lock the Mutex.

Definition at line 165 of file thread.cpp.

Referenced by TNL::ThreadQueue::lock(), TNL::EventConnection::packetDropped(), TNL::EventConnection::postNetEvent(), and TNL::EventConnection::writePacket().

bool TNL::Mutex::tryLock  
 

Attempts to acquire a lock to this Mutex, without blocking.

Returns true if the calling thread was able to lock the Mutex and false if the Mutex was already locked by another thread.

Definition at line 175 of file thread.cpp.

void TNL::Mutex::unlock  
 

Unlocks the Mutex.

The behavior of this method is undefined if called by a thread that has not previously locked this Mutex.

Definition at line 170 of file thread.cpp.

Referenced by TNL::EventConnection::packetDropped(), TNL::EventConnection::postNetEvent(), TNL::ThreadQueue::unlock(), and TNL::EventConnection::writePacket().


The documentation for this class was generated from the following files:
Generated on Thu Aug 18 16:03:37 2005 for Robin Hood: Thieves & Knights by doxygen1.2.18