TibrvQueueOnComplete::onComplete()

Method

Declaration

virtual void onComplete(
    TibrvQueue* queue,
    void* closure)

Purpose

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

Parameter

Description

queue

This parameter receives the queue object.

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

closure

This parameter receives the closure object that the program supplied in the destroy call.

Remarks

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

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

TibrvQueue::destroy() accepts an argument of type TibrvQueueOnComplete. Rendezvous software ensures that the completion method runs when the last callback-in-progress has completed.

See Also

TibrvQueue::destroy()