13
0

yet more debugging for thread pools

git-svn-id: svn://localhost/ardour2/branches/3.0@8451 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-01-06 00:01:33 +00:00
parent c9fdcd9346
commit fde57da354
2 changed files with 6 additions and 4 deletions

View File

@ -24,6 +24,7 @@
#include "pbd/error.h"
#include "pbd/enumwriter.h"
#include "pbd/stacktrace.h"
#include "ardour/ardour.h"
#include "ardour/audio_diskstream.h"
@ -60,7 +61,7 @@ SessionEvent::operator new (size_t)
{
CrossThreadPool* p = pool->per_thread_pool ();
SessionEvent* ev = static_cast<SessionEvent*> (p->alloc ());
cerr << "Allocating SessionEvent from " << p->name() << " ev @ " << ev << endl;
cerr << pthread_self() << " Allocating SessionEvent from " << p->name() << " ev @ " << ev << endl;
ev->own_pool = p;
return ev;
}
@ -71,7 +72,8 @@ SessionEvent::operator delete (void *ptr, size_t /*size*/)
Pool* p = pool->per_thread_pool ();
SessionEvent* ev = static_cast<SessionEvent*> (ptr);
cerr << "Deleting SessionEvent @ " << ev << " thread pool = " << p->name() << " ev pool = " << ev->own_pool->name() << endl;
cerr << pthread_self() << " Deleting SessionEvent @ " << ev << " thread pool = " << p->name() << " ev pool = " << ev->own_pool->name() << endl;
stacktrace (cerr, 20);
if (p == ev->own_pool) {
p->release (ptr);
} else {

View File

@ -246,9 +246,9 @@ void*
CrossThreadPool::alloc ()
{
void* ptr;
cerr << name() << " has " << pending.read_space() << " pending free entries waiting\n";
cerr << pthread_self() << ' ' << name() << " has " << pending.read_space() << " pending free entries waiting\n";
while (pending.read (&ptr, 1) == 1) {
cerr << name() << " pushes back a pending free list entry before allocating\n";
cerr << pthread_self() << ' ' << name() << " pushes back a pending free list entry before allocating\n";
free_list.write (&ptr, 1);
}
return Pool::alloc ();