{
CrossThreadPool* p = pool->per_thread_pool ();
SessionEvent* ev = static_cast<SessionEvent*> (p->alloc ());
- cerr << pthread_self() << " Allocating SessionEvent from " << p->name() << " ev @ " << ev << endl;
+ DEBUG_TRACE (DEBUG::SessionEvents, string_compose ("%1 Allocating SessionEvent from %2 ev @ %3\n", pthread_self(), p->name(), ev));
ev->own_pool = p;
return ev;
}
Pool* p = pool->per_thread_pool ();
SessionEvent* ev = static_cast<SessionEvent*> (ptr);
- cerr << pthread_self() << " Deleting SessionEvent @ " << ev << " thread pool = " << p->name() << " ev pool = " << ev->own_pool->name() << endl;
- stacktrace (cerr, 20);
+ DEBUG_TRACE (DEBUG::SessionEvents, string_compose (
+ "%1 Deleting SessionEvent @ %2 ev thread pool = %3 ev pool = %4\n",
+ pthread_self(), ev, p->name(), ev->own_pool->name()
+ ));
+
+#ifdef NDEBUG
+ if (DEBUG::SessionEvents & PBD::debug_bits) {
+ stacktrace (cerr, 20);
+ }
+#endif
+
if (p == ev->own_pool) {
p->release (ptr);
} else {
uint64_t PBD::DEBUG::Stateful = PBD::new_debug_bit ("stateful");
uint64_t PBD::DEBUG::Properties = PBD::new_debug_bit ("properties");
uint64_t PBD::DEBUG::FileManager = PBD::new_debug_bit ("filemanager");
+uint64_t PBD::DEBUG::Pool = PBD::new_debug_bit ("pool");
uint64_t PBD::debug_bits = 0x0;
extern uint64_t Stateful;
extern uint64_t Properties;
extern uint64_t FileManager;
+ extern uint64_t Pool;
}
}
#include "pbd/pool.h"
#include "pbd/error.h"
+#include "pbd/debug.h"
+#include "pbd/compose.h"
using namespace std;
using namespace PBD;
CrossThreadPool::alloc ()
{
void* ptr;
- cerr << pthread_self() << ' ' << name() << " has " << pending.read_space() << " pending free entries waiting\n";
+
+ DEBUG_TRACE (DEBUG::Pool, string_compose ("%1 %2 has %3 pending free entries waiting\n", pthread_self(), name(), pending.read_space()));
while (pending.read (&ptr, 1) == 1) {
- cerr << pthread_self() << ' ' << name() << " pushes back a pending free list entry before allocating\n";
+ DEBUG_TRACE (DEBUG::Pool, string_compose ("%1 %2 pushes back a pending free list entry before allocating\n", pthread_self(), name()));
free_list.write (&ptr, 1);
}
return Pool::alloc ();