tibrvftMonitorOnComplete
Function Type
Declaration
typedef void (*tibrvftMonitorOnComplete
) (
tibrvftMember destroyedMonitor,
void* closure);
Purpose
A program can destroy a monitor object even when its callback function is running in one or more threads. Multi-threaded programs can define functions of this type to discover when all callback functions 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 monitor the fault tolerance group. However, by the time this function runs, the monitor is already destroyed; this function cannot use the monitor object in Rendezvous calls. |
|
This parameter receives the closure data, which the program supplied in the call that created the monitor object. |
Remarks
This type of function is important in two situations:
• | Internal fault tolerance callback functions run in several threads (because several threads dispatch the monitor’s event queue), and the program must do additional processing after these callback functions have completed in all threads. |
• | A monitor callback function calls tibrvftMonitor_DestroyEx() to withdraw from a fault tolerance group, and the program must do additional processing after the rest of the callback function has completed. |
Upon return from tibrvftMonitor_DestroyEx()
, the destroyed monitor’s callback function can no longer begin to run (this is also true of internal callback functions). However, in each thread where a callback function is already in progress, that callback function does continue to run until complete.
tibrvftMonitor_DestroyEx()
accepts a completion function argument of type tibrvftMonitorOnComplete. Rendezvous software ensures that the completion function runs when the last callback-in-progress has completed.
Timing and Context
This information in completely analogous to tibrvEventOnComplete. See that section for important details.