void myqtt_exit_ctx ( MyQttCtx ctx,
axl_bool  free_ctx 
)

Terminates the myqtt library execution on the provided context.

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

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

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

Parameters
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 myqtt_ctx_free).

References myqtt_ctx_free2(), myqtt_init_check(), myqtt_listener_unlock(), myqtt_mutex_destroy(), myqtt_mutex_lock(), myqtt_mutex_unlock(), and myqtt_support_cleanup().

Referenced by myqttd_exit().