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

PriorityMutex Class Reference

#include <PriorityMutex.h>

Inheritance diagram for PriorityMutex:

Lockable NonCopyable List of all members.

Public Methods

 PriorityMutex ()
 Create a PriorityMutex.

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

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:49-0400>
Version:
2.2.1
A PriorityMutex is similar to a Mutex, with exception that a PriorityMutex has a difference scheduling policy. It is a non-reentrant, priority sensative MUTual EXclusion Lockable object.

See also:
Mutex
Scheduling

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


Member Function Documentation

virtual void acquire   [virtual]
 

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

Only one thread may acquire() the PriorityMutex 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 PriorityMutex more than once, without having first release()ed it.
Precondition:
the calling thread must not have already acquire()ed PriorityMutex
Postcondition:
the calling thread succesfully acquire()ed PriorityMutex only if no exception was thrown.
See also:
Lockable::acquire()

Implements Lockable.

virtual void release   [virtual]
 

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

see Lockable::release()

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

Implements Lockable.

virtual bool tryAcquire unsigned    long [virtual]
 

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

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

Parameters:
timeout  - maximum amount of time (milliseconds) this method could block
Returns :
bool true if the PriorityMutex 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 PriorityMutex more than once, without having first release()ed it.
Precondition:
the calling thread must not have already acquire()ed PriorityMutex
Postcondition:
the calling thread succesfully acquire()ed PriorityMutex 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:14 2002 for ZThread by doxygen1.2.17