void vortex_exit_ctx ( VortexCtx ctx,
axl_bool  free_ctx 

Terminates the vortex library execution on the provided context.

Stops all internal vortex process and all allocated resources associated to the context. It also close all channels for all connection that where not closed until call this function.

This function is reentrant, allowing several threads to call vortex_exit_ctx function at the same time. Only one thread will actually release resources allocated.

NOTE: Although it isn't explicitly stated, this function shouldn't be called from inside a handler notification: Frame Receive, Channel close, etc. This is because those handlers works inside the context of the vortex library execution. Making a call to this function in the middle of that context, will produce undefined behaviors.

NOTE2: This function isn't designed to dealloc all resources associated to the context and used by the vortex engine function. According to the particular control structure used by your application, you must first terminate using any Vortex API and then call to vortex_exit_ctx. In other words, this function won't close all your opened connections.

ctxThe context to terminate. The function do not dealloc the context provided.
free_ctxAllows to signal the function if the context provided must be deallocated (by calling to vortex_ctx_free).

Notes about calling to terminate vortex from inside its handlers:

Currently this is allowed and supported only in the following handlers:

The rest of handlers has being not tested.

References vortex_ctx_free2(), vortex_init_check(), vortex_listener_unlock(), vortex_mutex_destroy(), vortex_mutex_lock(), vortex_mutex_unlock(), and vortex_support_cleanup().