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

PriorityInheritanceMutex Class Reference

#include <PriorityInheritanceMutex.h>

Inheritance diagram for PriorityInheritanceMutex:

Lockable NonCopyable List of all members.

Public Methods

 PriorityInheritanceMutex ()
 Create a new PriorityInheritanceMutex.

virtual ~PriorityInheritanceMutex () throw ()
 Destroy this PriorityInheritanceMutex.

virtual void acquire ()
virtual bool tryAcquire (unsigned long)
virtual void release ()

Detailed Description

Author:
Eric Crahen <crahen@cse.buffalo.edu>
Date:
<2002-06-02T08:10:44-0400>
Version:
2.2.1
A PriorityInheritanceMutex is similar to a PriorityMutex, it is a non-reentrant, priority sensative MUTual EXclusion Lockable object. It differs only in its scheduling policy.

See also:
PriorityMutex
Scheduling

Threads competing to acquire() a PriorityInheritanceMutex are granted access in order of priority. Threads with a higher priority will be given access first.

When a higher priority thread tries to acquire() a PriorityInheritanceMutex and is about to be blocked by a lower priority thread that has alerady acquire()d it, the lower priority thread will temporarily have its effective priority raised to that of the higher priority thread until it release()s the mutex; at which point its previous priority will be restored.


Member Function Documentation

virtual void acquire   [virtual]
 

Acquire a PriorityInheritanceMutex, possbily blocking until the the current owner of the PriorityInheritanceMutex release()es it or until an exception is thrown.

Only one thread may acquire() the PriorityInheritanceMutex at any given time.

Exceptions:
Interrupted_Exception  thrown when the calling thread is interupt()ed. A thread may be interrupted at any time, prematurely ending any wait.
Deadlock_Exception  thrown when the same thread attempts to acquire() a PriorityInheritanceMutex more than once, without having first release()ed it.
Precondition:
the calling thread must not have already acquire()ed PriorityInheritanceMutex
Postcondition:
the calling thread succesfully acquire()ed PriorityInheritanceMutex only if no exception was thrown.
See also:
Lockable::acquire()

Implements Lockable.

virtual void release   [virtual]
 

Release a PriorityInheritanceMutex allowing another thread to acquire() it.

see Lockable::release()

Exceptions:
InvalidOp_Exception  - thrown if there is an attempt to release() this PriorityInheritanceMutex from the context of a thread that had not previously acquire()ed it.
Precondition:
the calling thread must have first acquire()d the PriorityInheritanceMutex.
Postcondition:
the calling thread succesfully release()d PriorityInheritanceMutex only if no exception was thrown.
See also:
Lockable::acquire()

Implements Lockable.

virtual bool tryAcquire unsigned    long [virtual]
 

Acquire a PriorityInheritanceMutex, possbily blocking until the the current owner of the PriorityInheritanceMutex release()es it, until an exception is thrown or until the given amount of time expires.

Only one thread may acquire() the PriorityInheritanceMutex at any given time.

Parameters:
timeout  - maximum amount of time (milliseconds) this method could block
Returns :
bool true if the PriorityInheritanceMutex was acquire()ed before the timeout expired, otherwise false
Exceptions:
Interrupted_Exception  thrown when the calling thread is interupt()ed. A thread may be interrupted at any time, prematurely ending any wait.
Deadlock_Exception  thrown when the same thread attempts to acquire() a PriorityInheritanceMutex more than once, without having first release()ed it.
Precondition:
the calling thread must not have already acquire()ed PriorityInheritanceMutex
Postcondition:
the calling thread succesfully acquire()ed PriorityInheritanceMutex only if no exception was thrown.
See also:
Lockable::tryAcquire(unsigned long)

Implements Lockable.


The documentation for this class was generated from the following file:
Generated on Tue Aug 27 07:43:13 2002 for ZThread by doxygen1.2.17