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

PriorityCondition Class Reference

#include <PriorityCondition.h>

Inheritance diagram for PriorityCondition:

Waitable NonCopyable List of all members.

Public Methods

 PriorityCondition (Lockable &l)
 ~PriorityCondition () throw ()
 Destroy PriorityCondition object.

void signal ()
void broadcast ()
virtual void wait ()
virtual bool wait (unsigned long timeout)

Detailed Description

Author:
Eric Crahen <crahen@cse.buffalo.edu>
Date:
<2002-06-02T08:11:02-0400>
Version:
2.2.1
A PriorityCondition is a Condition that is sensative to thread priority.

See also:
Condition
Scheduling

Threads blocked on a PriorityCondition are resumed in priority order, highest priority first


Constructor & Destructor Documentation

PriorityCondition Lockable   l
 

Create a new condition variable associated with the given Lockable object.

Parameters:
l  - Lockable object to associate with this PriorityCondition object.
Exceptions:
Synchronization_Exception  thrown if there is some error creating the PriorityCondition object


Member Function Documentation

void broadcast  
 

Wake ALL threads wait()ing on this PriorityCondition.

Postcondition:
all wait()ing threads, if any exist, will be awakened.
Exceptions:
Synchronization_Exception  thrown if there is an error performing this operation

void signal  
 

Wake ONE threads wait()ing on this PriorityCondition.

Postcondition:
a wait()ing thread, if any exists, will be awakened.
Exceptions:
Synchronization_Exception  thrown if there is an error performing this operation

virtual bool wait unsigned long    timeout [virtual]
 

Wait for this PriorityCondition object to be signal()ed. The thread calling this method will block until the PriorityCondition is signal()ed, broadcast() to or until the timeout expires.

This operation atomically release()s the associated Lockable and blocks the calling thread.

Parameters:
timeout  - maximum amount of time (milliseconds) this method could block
Returns :
true if the PriorityCondition was signal()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.
Precondition:
The thread calling this method must have first acquire()d the associated Lockable object.
Postcondition:
A thread that has resumed execution without exception (because of a signal(), broadcast() or exception) will have acquire()d the associated Lockable object before returning from a wait().
See also:
Waitable::wait(timeout)

Reimplemented from Waitable.

virtual void wait   [virtual]
 

Wait for this PriorityCondition object to be signal()ed. The thread calling this method will block until the PriorityCondition is signal()ed or broadcast() to.

This operation atomically release()s the associated Lockable and blocks the calling thread.

Exceptions:
Interrupted_Exception  thrown when the calling thread is interupt()ed. A thread may be interrupted at any time, prematurely ending any wait.
Precondition:
The thread calling this method must have first acquire()d the associated Lockable object.
Postcondition:
A thread that has resumed execution without exception (because of a signal(), broadcast() or exception) will have acquire()d the associated Lockable object before returning from a wait().
See also:
Waitable::wait()

Reimplemented from Waitable.


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