diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-26 16:15:11 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-26 16:15:11 +0000 |
commit | 35c72a53b4c6bbc61b4b86db9de629e18362b48d (patch) | |
tree | 50234bfc778bcf933264a4dbb3d2e58a6691c73c /libs/pbd/boost_debug.cc | |
parent | b6f4cdaea27fbf49f924b2684d4c638089314067 (diff) |
change the way thread name is managed and accessed; store thread name for JACK thread(s); remove bits of debugging output
git-svn-id: svn://localhost/ardour2/branches/3.0@6399 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/boost_debug.cc')
-rw-r--r-- | libs/pbd/boost_debug.cc | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/libs/pbd/boost_debug.cc b/libs/pbd/boost_debug.cc index f828f7d17b..751941983c 100644 --- a/libs/pbd/boost_debug.cc +++ b/libs/pbd/boost_debug.cc @@ -65,7 +65,7 @@ Backtrace::print (std::ostream& str) const strings = ::backtrace_symbols (trace, size); #endif if (strings) { - for (i = 5; i < 5+18 && i < size; i++) { + for (i = 3; i < 5+18 && i < size; i++) { str << strings[i] << std::endl; } free (strings); @@ -204,13 +204,51 @@ boost_debug_shared_ptr_operator_equals (void const *sp, void const *old_obj, int } void -boost_debug_shared_ptr_reset (void const *sp, void const *obj, int use_count) +boost_debug_shared_ptr_reset (void const *sp, void const *old_obj, int old_use_count, void const *obj, int new_use_count) { - if (is_interesting_object (obj)) { + if (old_obj == 0 && obj == 0) { + return; + } + + Glib::Mutex::Lock guard (the_lock); + + if (is_interesting_object (old_obj) || is_interesting_object (obj)) { if (debug_out) { - cerr << "reset sp to object @ " << obj << " @ " << sp << " UC was " << use_count << " (total sp's = " << sptrs.size() << ')' << endl; + cerr << "RESET SWAPS " << old_obj << " & " << obj << endl; + } + } + + if (is_interesting_object (old_obj)) { + if (debug_out) { + cerr << "\tlost old sp @ " << sp << " for " << old_obj << " UC = " << old_use_count << " now for " << obj << " UC = " << new_use_count + << " (total sp's = " << sptrs.size() << ')' << endl; + } + PointerMap::iterator x = sptrs.find (sp); + + if (x != sptrs.end()) { + sptrs.erase (x); + if (debug_out) { + cerr << "\tRemoved (by reset) sp for " << old_obj << " @ " << sp << " UC = " << old_use_count << " (total sp's = " << sptrs.size() << ')' << endl; + } } } + + if (is_interesting_object (obj)) { + + pair<void const*, SPDebug*> newpair; + + newpair.first = sp; + newpair.second = new SPDebug (new Backtrace()); + + sptrs.insert (newpair); + + if (debug_out) { + cerr << "reset created sp for " << obj << " @ " << sp << " used to point to " << old_obj << " UC = " << old_use_count + << " UC = " << new_use_count + << " (total sp's = " << sptrs.size() << ')' << endl; + cerr << *newpair.second << endl; + } + } } void |