X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbctrace.C;h=84cd48f5e07b638c1b2a78a1cd8c9ec1613971f2;hb=868d94b3bcbdcd3bb3c200839f1f55886da148eb;hp=7e279673729845fafc3775cfaaf686b8a1513909;hpb=54cc56bff09f5004b2a6cd454375f06e56acf5a0;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/bctrace.C b/cinelerra-5.1/guicast/bctrace.C index 7e279673..84cd48f5 100644 --- a/cinelerra-5.1/guicast/bctrace.C +++ b/cinelerra-5.1/guicast/bctrace.C @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + + #include #include #include @@ -309,6 +330,9 @@ void BC_Trace::dump_traces(FILE *fp) } } +void trace_info::set_owner() { owner = (unsigned long)pthread_self(); } +void trace_info::unset_owner() { owner = 0; } + void BC_Trace::dump_locks(FILE *fp) { // Dump lock table @@ -316,8 +340,12 @@ void BC_Trace::dump_locks(FILE *fp) fprintf(fp,"signal_entry: lock table size=%d\n", lock_table.size); for( trace_item *tp=lock_table.first; tp!=0; tp=tp->next ) { lock_item *p=(lock_item*)tp; - fprintf(fp," %p %s %s %p%s\n", p->info, p->title, - p->loc, (void*)p->tid, p->is_owner ? " *" : ""); + fprintf(fp," %p %s, %s %p%s", + p->info, p->title, p->loc, + (void*)p->tid, p->is_owner ? " *" : ""); + if( p->info->owner && p->info->owner != (unsigned long)p->tid ) + fprintf(fp," %p", (void*)p->info->owner); + fprintf(fp,"\n"); } int64_t lock_total = lock_table.total(); int64_t free_total = lock_free.total();