joinable (): determines whether you can use join () or detach (), returns true representation may use join () or detach ()
Returns not represented fasle
void fun_th()
{
cout << "thread of execution" << endl;
}
thread myth(fun_th);
if(myth.joinable())
{
cout<<"joinable() == true"<<endl;
}else{
cout<<"joinable() == fasle"<<endl;
}
myth.datach();
if(myth.joinable())
{
cout<<"joinable() == true"<<endl;
}else{
cout<<"joinable() == fasle"<<endl;
}