X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbctrace.h;h=51dafd7466bf4ca6174636a9340a1a948b68c791;hb=b9f98da8f1cd8b7b31ead02fa41f299b56cac3da;hp=fc35817eadd1405f4951589f37bc7ad80db2915b;hpb=d348518c261d543e12282d516768d4f446434a42;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/guicast/bctrace.h b/cinelerra-5.1/guicast/bctrace.h index fc35817e..51dafd74 100644 --- a/cinelerra-5.1/guicast/bctrace.h +++ b/cinelerra-5.1/guicast/bctrace.h @@ -8,6 +8,12 @@ #include "cstrdup.h" #include +#ifdef BOOBY +#define BT if( top_level->display_lock_owner != pthread_self() ) booby(); +void booby(); +#else +#define BT +#endif class BC_Trace { @@ -220,24 +226,17 @@ public: static void dbg_add(pthread_t tid, pthread_t owner, const char *nm); static void dbg_del(pthread_t tid); static void reset() { the_list.remove_all_objects(); TheLocker::reset(); } - TheList() {} - ~TheList() { reset(); } -}; - -class TheChk { -public: - static TheChk the_chk; - - TheChk() {} - ~TheChk() { - int i = TheList::the_list.size(); + void check() { + int i = the_list.size(); if( !i ) return; printf("unjoined tids / owner %d\n", i); while( --i >= 0 ) printf(" %016lx / %016lx %s\n", - (unsigned long)TheList::the_list[i]->tid, - (unsigned long)TheList::the_list[i]->owner, - TheList::the_list[i]->name); + (unsigned long)the_list[i]->tid, + (unsigned long)the_list[i]->owner, + the_list[i]->name); } + TheList() {} + ~TheList() { check(); reset(); } }; #endif