DB_LOG_* macros have a leaking lock
The lock should not leak outside the macro because that would make macros not callable twice inside the same scope and in all downstream functions. That would lead to a deadlock. Even though this is probably not going to occur because as we've done unitl now, we log once per function and these functions return imeddiately, this might not seem intuitive for further use.
Suggestion:
-
Make a way to limit lock scope, maybe curly brackets inside the macro to limit it's scope to itself or maybe a template with variadic arguments. -
Add a unit test that will test that the mutex is not taken after calling this macro.
Derived from #1711 (closed)
Edited by Andrei Pavel