TibrvFtMonitorOnComplete::onComplete
Method
Declaration
virtual voidonComplete
(
TibrvFtMonitor* ftMonitor) = 0;
Purpose
A program can destroy a monitor object even when its callback method is running in one or more threads. Multi-threaded programs can define methods of this type to discover when all callback methods in progress have completed.
Parameter |
Description |
|
This parameter receives the monitor event object. This object is identical to the object that the program created to begin monitoring the fault tolerance group. However, by the time this method runs, the monitor is already destroyed; this method cannot use the monitor object in Rendezvous calls. |
Remarks
This type of method is important in two situations:
• | Internal fault tolerance callback methods run in several threads (because several threads dispatch the monitor’s event queue), and the program must do additional processing after these callback methods have completed in all threads. |
• | A member callback method calls TibrvFtMonitor::destroy() to stop monitoring a fault tolerance group, and the program must do additional processing after the rest of the callback method has completed. |
Upon return from TibrvFtMonitor::destroy(), the destroyed monitor’s callback method can no longer begin to run (this is also true of internal callback methods). However, in each thread where a callback method is already in progress, that callback method does continue to run until complete.
TibrvFtMonitor::destroy() accepts a completion argument of type TibrvFtMonitorOnComplete. Rendezvous software ensures that the completion method runs when the last callback-in-progress has completed.
Timing and Context
This information in completely analogous to TibrvEventOnComplete::onComplete(). See that section for important details.