tibrvQueueOnComplete

Function Type

Declaration

typedef void (*tibrvQueueOnComplete) (
    tibrvQueue   destroyedQueue,
    void*        closure);

Purpose

A program can destroy a queue object even when callback functions from its events are running in one or more threads. Multi-threaded programs can define functions of this type to discover when all event callback functions in progress have completed.

Parameter

Description

destroyedQueue

This parameter receives the queue object.

However, by the time this function runs, the queue is already destroyed; this function cannot use the queue object in Rendezvous calls.

closure

This parameter receives the closure data, which the program supplied in the call that destroyed the queue object.

Remarks

This type of function is important when several threads dispatch from the same queue, and the program must do additional processing after the callback functions have completed in all threads.

Upon return from tibrvQueue_DestroyEx(), the destroyed queue can no longer dispatch events. However, in each thread where an event callback function is already in progress, that callback function does continue to run until complete.

tibrvQueue_DestroyEx() accepts a completion function argument of type tibrvQueueOnComplete. Rendezvous software ensures that the completion function runs when the last callback-in-progress has completed.

See Also

tibrvQueue_Destroy()