void valvula_ctx_unref2 ( ValvulaCtx **  ctx,
const char *  who 

Decrease reference count and nullify caller's pointer in the case the count reaches 0.

ctxThe context to decrement reference count. In the case 0 is reached the ValvulaCtx instance is deallocated and the callers reference is nullified.
whoAn string that identifies this ref. Useful for debuging.

References _valvula_log(), valvula_ctx_free2(), valvula_mutex_lock(), and valvula_mutex_unlock().

Referenced by valvula_ctx_unref().