p/s proxy icon, rework window locks, segv in close_mixers + exportedl, ffmpeg default...
[goodguy/history.git] / cinelerra-5.1 / guicast / bctrace.C
index c50fff5f45acd2ce4681f222374fe77ebac9c753..930eabfc50f6bf562969812b3810c664e6782c75 100644 (file)
@@ -5,6 +5,21 @@
 
 #include "bctrace.h"
 
+#ifdef BOOBY
+#include <execinfo.h>
+#define BT_BUF_SIZE 100
+// booby trap (backtrace)
+void booby() {
+       printf("BOOBY!\n"); 
+       void *buffer[BT_BUF_SIZE];
+       int nptrs = backtrace(buffer, BT_BUF_SIZE);
+       char **trace = backtrace_symbols(buffer, nptrs);
+       if( !trace ) return;
+       for( int i=0; i<nptrs; ) printf("%s\n", trace[i++]);
+       free(trace);
+}
+#endif
+
 BC_Trace *BC_Trace::global_trace = 0;
 int trace_memory = 0;
 int trace_locks = 1;
@@ -345,7 +360,6 @@ void BC_Trace::unset_temp(char *string)
 
 TheLock TheLocker::the_lock;
 TheList TheList::the_list;
-TheChk TheChk::the_chk;
 
 int lock_item::table_id = 0;
 
@@ -353,7 +367,7 @@ void TheList::dbg_add(pthread_t tid, pthread_t owner, const char *nm)
 {
        TheLocker the_locker;
        int i = the_list.size();
-       while( --i >= 0 && the_list[i]->tid != tid );
+       while( --i >= 0 && !(the_list[i]->tid == tid && the_list[i]->owner == owner) );
        if( i >= 0 ) {
                printf("dbg_add, dup %016lx %s %s\n",
                        (unsigned long)tid, nm, the_list[i]->name);