LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::mutex Class Reference

lti mutex class More...

#include <ltiMutex.h>

Inheritance diagram for lti::mutex:
Inheritance graph
[legend]
Collaboration diagram for lti::mutex:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 mutex ()
virtual ~mutex ()
void lock ()
bool tryLock ()
void unlock ()
virtual const char * getTypeName () const

Protected Attributes

HANDLE theMutex

Detailed Description

lti mutex class

This object can be used to protect critical sections on multithreaded applications. The same thread should NOT try to lock the mutex more than once. The behavior of this will depend on the operating system: on linux/unix the thread will be locked forever (posix standard); on windows, the thread will count how many lock have been done, but it will not be blocked by the later locks!

See also:
lti::semaphore, lti::thread

Constructor & Destructor Documentation

lti::mutex::mutex (  ) 

default constructor

virtual lti::mutex::~mutex (  )  [virtual]

destructor


Member Function Documentation

virtual const char* lti::mutex::getTypeName (  )  const [virtual]

returns the name of this type

Reimplemented from lti::object.

void lti::mutex::lock (  ) 

wait until lock for mutex becomes available and lock it

Referenced by lti::lapackInterface::lockInterface().

bool lti::mutex::tryLock (  ) 

Try to lock mutex, but do not block.

Returns:
true if locking was successful.
void lti::mutex::unlock (  ) 

Member Data Documentation

HANDLE lti::mutex::theMutex [protected]

the WIN32 mutex objects


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

Generated on Sat Apr 10 15:28:52 2010 for LTI-Lib by Doxygen 1.6.1