framexmit::mutex Class Reference
[Frame multicast client/server]

#include <fxmitmutex.hh>

Inheritance diagram for framexmit::mutex:

framexmit::abstractsemaphore framexmit::recursivemutex

List of all members.

Public Member Functions

 mutex ()
virtual ~mutex ()
 mutex (const mutex &)
mutexoperator= (const mutex &mux)
virtual void lock ()
virtual void readlock ()
virtual void writelock ()
virtual void unlock ()
virtual bool trylock (locktype lt=rdlock)

Protected Attributes

mutexID_t mux
 Mutex identifier.


Detailed Description

This class is used as a wrapper around a system defined mutex. During construction the mutex is created and during desctruction it is automatically destroyed. A mutex object describes a unique mutex which can not be copied. When passing a mutex object to a function it has to be passed by reference or by pointer (never by value). There are methods to lock, unlock and trylock the mutex. On Unix the object uses the POSIX standard, whereas under VxWorks it uses the native mutex Lock and unlock methods must always be used in pairs within the same context.

brief Class to store a mutex.

Author:
DS, November 98
See also:
Mutex objects

Constructor & Destructor Documentation

framexmit::mutex::mutex (  )  [inline]

Constructs a mutex object and creates a new mutex. brief Default constructor.

Returns:
void

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

Destructs a mutex object and destroyes the mutex. brief Default destructor.

Returns:
void

framexmit::mutex::mutex ( const mutex  )  [inline]

Constructs a mutex object, overwritting the default copy constructor by creating a new mutex. brief Copy constructor.

Returns:
void


Member Function Documentation

mutex& framexmit::mutex::operator= ( const mutex mux  )  [inline]

Overrides the default assignment behaviour. Does nothing. brief Assignment operator.

Parameters:
mux mutex copy argument
Returns:
refrence to object

virtual void framexmit::mutex::lock (  )  [inline, virtual]

Locks the mutex. If the mutex is not available waits until it becomes free. brief Mutex lock function.

Returns:
void

Implements framexmit::abstractsemaphore.

Reimplemented in framexmit::recursivemutex.

virtual void framexmit::mutex::readlock (  )  [inline, virtual]

Locks the mutex for read, same as lock(). brief Mutex readlock function.

Returns:
void

Implements framexmit::abstractsemaphore.

virtual void framexmit::mutex::writelock (  )  [inline, virtual]

Locks the mutex for write, same as lock(). brief Mutex writelock function.

Returns:
void

Implements framexmit::abstractsemaphore.

virtual void framexmit::mutex::unlock (  )  [inline, virtual]

Unlocks the mutex. The mutex becomes free. brief Mutex unlock function.

Returns:
void

Implements framexmit::abstractsemaphore.

Reimplemented in framexmit::recursivemutex.

virtual bool framexmit::mutex::trylock ( locktype  lt = rdlock  )  [inline, virtual]

Trys to lock the mutex. If the mutex is free, it gets locked and the method returns true. If the mutex is already taken, the method returns false. brief Mutex trylock function.

Parameters:
lt writeaccess ignored
Returns:
true if locked, false otherwise

Implements framexmit::abstractsemaphore.

Reimplemented in framexmit::recursivemutex.


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:24 2009 for dmt by  doxygen 1.5.4