Log thread creation and destruction
This commit is contained in:
parent
13d536c119
commit
27ac054883
1 changed files with 3 additions and 1 deletions
|
|
@ -92,6 +92,7 @@ namespace fc {
|
||||||
p->wait();
|
p->wait();
|
||||||
my->boost_thread = t;
|
my->boost_thread = t;
|
||||||
my->name = name;
|
my->name = name;
|
||||||
|
wlog("name:${n} tid:${tid}", ("n", name)("tid", (uintptr_t)my->boost_thread->native_handle()) );
|
||||||
}
|
}
|
||||||
thread::thread( thread_d* ) {
|
thread::thread( thread_d* ) {
|
||||||
my = new thread_d(*this);
|
my = new thread_d(*this);
|
||||||
|
|
@ -111,7 +112,7 @@ namespace fc {
|
||||||
//wlog( "my ${n}", ("n",name()) );
|
//wlog( "my ${n}", ("n",name()) );
|
||||||
if( my )
|
if( my )
|
||||||
{
|
{
|
||||||
wlog( "calling quit()" );
|
wlog( "calling quit() on ${n}",("n",my->name) );
|
||||||
quit(); // deletes `my`
|
quit(); // deletes `my`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -156,6 +157,7 @@ namespace fc {
|
||||||
async( [=](){quit();}, "thread::quit" );//.wait();
|
async( [=](){quit();}, "thread::quit" );//.wait();
|
||||||
if( my->boost_thread )
|
if( my->boost_thread )
|
||||||
{
|
{
|
||||||
|
wlog("destroying boost thread ${tid}",("tid",(uintptr_t)my->boost_thread->native_handle()));
|
||||||
my->boost_thread->join();
|
my->boost_thread->join();
|
||||||
delete my;
|
delete my;
|
||||||
my = nullptr;
|
my = nullptr;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue