mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
use PBD::DEBUG::Threads as a toggle to show thread ID/name with debug output
This commit is contained in:
parent
a59c217205
commit
37f859197b
1 changed files with 5 additions and 0 deletions
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include "pbd/debug.h"
|
#include "pbd/debug.h"
|
||||||
#include "pbd/error.h"
|
#include "pbd/error.h"
|
||||||
|
#include "pbd/pthread_utils.h"
|
||||||
|
|
||||||
#include "pbd/i18n.h"
|
#include "pbd/i18n.h"
|
||||||
|
|
||||||
|
|
@ -102,6 +103,10 @@ PBD::new_debug_bit (const char* name)
|
||||||
void
|
void
|
||||||
PBD::debug_only_print (const char* prefix, string str)
|
PBD::debug_only_print (const char* prefix, string str)
|
||||||
{
|
{
|
||||||
|
if ((PBD::debug_bits & DEBUG::Threads).any()) {
|
||||||
|
printf ("0x%x (%s) ", (int) DEBUG_THREAD_SELF, pthread_name());
|
||||||
|
}
|
||||||
|
|
||||||
if ((PBD::debug_bits & DEBUG::DebugTimestamps).any()) {
|
if ((PBD::debug_bits & DEBUG::DebugTimestamps).any()) {
|
||||||
printf ("%ld %s: %s", g_get_monotonic_time(), prefix, str.c_str());
|
printf ("%ld %s: %s", g_get_monotonic_time(), prefix, str.c_str());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue