void myqtt_log_acquire_mutex ( MyQttCtx ctx,
axl_bool  status 

If activate the console debug, it may happen that some messages are mixed because several threads are producing them at the same time.

This function allows to make all messages logged to acquire a mutex before continue. It is by default disabled because it has the following considerations:

  • Acquiring a mutex allow to clearly separate messages from different threads, but has a great perform penalty (only if log is activated).
  • Acquiring a mutex could make the overall system to act in a different way because the threading is now globally synchronized by all calls done to the log. That is, it may be possible to not reproduce a thread race condition if the log is activated with mutex acquire.
ctxThe context that is going to be configured.
statusaxl_true to acquire the mutex before logging, otherwise log without locking the context mutex.

You can use myqtt_log_is_enabled_acquire_mutex to check the mutex status.