anonymous contribution for much improved ChromakeyHSV plugin menu with boxes to set...
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / bctrace.C
index 7e279673729845fafc3775cfaaf686b8a1513909..84cd48f5e07b638c1b2a78a1cd8c9ec1613971f2 100644 (file)
@@ -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 <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -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();