tibrv_Close()

Function

Declaration

tibrv_status tibrv_Close(void);

Purpose

Stop and destroy Rendezvous internal machinery.

Remarks

After tibrv_Close() destroys the internal machinery, Rendezvous software becomes inoperative:

Events no longer arrive in queues.
All events and queues are unusable, so programs can no longer dispatch events.
All transports are unusable, so programs can no longer send outbound messages.

tibrv_Close() frees storage associated with events, queues, queue groups, transports and dispatcher threads. However, tibrv_Close() does not destroy Rendezvous messages; the program must explicitly destroy messages to reclaim their storage.

Programs can call tibrv_Close() in any thread.

Reference Count

A reference count protects against interactions between programs and third-party packages that call tibrv_Open() and tibrv_Close(). Each call to tibrv_Open() increments an internal counter; each call to tibrv_Close() decrements that counter. A call to tibrv_Open() actually creates internal machinery only when the reference counter is zero; subsequent calls merely increment the counter, but do not duplicate the machinery. A call to tibrv_Close() actually destroys the internal machinery only when the call decrements the counter to zero; other calls merely decrement the counter. In each program, the number of calls to tibrv_Open() and tibrv_Close() must match.

See Also

tibrv_Open()