Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
TReentrantMonitorCondition
Purpose:
A concrete class used to implement conditions in the monitor and conditions programming model.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Derived classes override the virtual member functions and add additional member functions. Clients should be careful to implement the proper monitor and conditions programming model semantics when overriding the virtual member functions.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
- TMonitorCondition (TMonitorLock * theLock)
- TMonitorCondition (TMonitorLock * theLock, const TTime & maximumDelay)
Interface Category:
API.
Purpose:
- Constructor.
- Constructor.
Calling Context:
- Called to create a condition object associated with a particular monitor.
- Called to create a condition object associated with a particular monitor.
Parameters:
Return Value:
None.
Exceptions:
Throws TMonitorException(TMonitorException::kInvalidMonitor) if theLock is NIL.
Throws TMonitorException(TMonitorException::kConditionInitializationFailed) if an error occurred while initializing the internal state of the object.
Throws TSemaphoreException(TSemaphoreException::kBadWaitTimeArgument) if a negative timeout delay is passed.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual ~ TMonitorCondition ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
- virtual void Wait ()
- virtual void Wait (const TTime & maximumTimeToWait)
Interface Category:
API.
Purpose:
- Waits for a condition to be signaled.
- Waits for a condition to be signaled.
Calling Context:
- Called by a thread that has obtained the monitor with which the condition is associated.
- Called by a thread that has obtained the monitor with which the condition is associated.
Parameters:
- Takes no parameters.
- const TTime & maximumTimeToWait -The maximum time to wait for the condition to be signaled.
Return Value:
None.
Exceptions:
Throws TMonitorException(TMonitorException::kConditionWaitFailed) if an error occurred while waiting on the condition.
Throws TSemaphoreException(TSemaphoreException::kBadWaitTimeArgument) if a negative timeout delay is passed.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void Notify ()
Interface Category:
API.
Purpose:
Signals one waiter that the condition has occurred.
Calling Context:
Called by a thread that holds the monitor with which the condition is associated.
Parameters:
Return Value:
None.
Exceptions:
Throws TMonitorException(TMonitorException::kConditionSignalFailed) if an error occurred while signaling the condition.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void Broadcast ()
Interface Category:
API.
Purpose:
Signals all waiters that the condition has occurred.
Calling Context:
Called by a thread that holds the monitor with which the condition is associated.
Parameters:
Return Value:
None.
Exceptions:
Throws TMonitorException(TMonitorException::kConditionSignalFailed) if an error occurred while signaling the condition.
Concurrency:
Multithread safe.
Other Considerations:
None.
void GetDefaultDelay (TTime & theTime) const
Interface Category:
API.
Purpose:
Returns the default wait time used when waiting for the condition to be signaled.
Calling Context:
Called to query the internal state of the TMonitorCondition object.
Parameters:
- TTime & theTime -The default wait time used by the condition.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void SetDefaultDelay (const TTime & maximumDelay)
Interface Category:
API.
Purpose:
Set the default wait time used when waiting for the condition to be signaled.
Calling Context:
Called to change the wait time for the condition.
Parameters:
- const TTime & maximumDelay -The new default timeout value to be used when waiting for the condition to be signaled.
Return Value:
None.
Exceptions:
Throws TMonitorException(TMonitorException::kCantDetermineCause) if an error occurred while setting the delay time.
Concurrency:
Multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.