diff --git a/src/thread.cpp b/src/thread.cpp index eb2b604..53b95d3 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -34,6 +34,8 @@ namespace fc { elog( "Caught unhandled exception" ); } slog( "exiting %s", name ); + delete this->my; + slog( "..." ); } ); p->wait(); my->boost_thread = t; @@ -71,9 +73,12 @@ namespace fc { void thread::quit() { if( ¤t() != this ) { wlog( "async quit %s", my->name.c_str() ); - async( [=](){quit();} ).wait(); + async( [=](){quit();} );//.wait(); if( my->boost_thread ) { + auto n = name(); + slog( "joining... %s", n.c_str() ); my->boost_thread->join(); + slog( "done joining... %s", n.c_str() ); } return; } diff --git a/src/thread_d.hpp b/src/thread_d.hpp index 815b633..578239e 100644 --- a/src/thread_d.hpp +++ b/src/thread_d.hpp @@ -321,6 +321,7 @@ namespace fc { if( done ) return; if( timeout_time == time_point::max() ) { + slog("wait"); task_ready.wait( lock ); } else if( timeout_time != time_point::min() ) { slog("timed wait");