#include <iostream>
#include <thread>
int main() {
try{
std::thread th([](){ std::cout << __FUNCTION__ << std::endl; });
std::cout << th.joinable() << std::endl;
std::this_thread::sleep_for(std::chrono::microseconds(5000));
std::cout << th.joinable() << std::endl;
th.join();
std::cout << th.joinable() << std::endl;
}catch(std::exception& e){
std::cout << e.what() << std::endl;
}
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHRocmVhZD4KCmludCBtYWluKCkgewogICAgdHJ5ewogICAgICAgIHN0ZDo6dGhyZWFkIHRoKFtdKCl7IHN0ZDo6Y291dCA8PCBfX0ZVTkNUSU9OX18gPDwgc3RkOjplbmRsOyB9KTsKICAgICAgICBzdGQ6OmNvdXQgPDwgdGguam9pbmFibGUoKSA8PCBzdGQ6OmVuZGw7CiAgICAgICAgc3RkOjp0aGlzX3RocmVhZDo6c2xlZXBfZm9yKHN0ZDo6Y2hyb25vOjptaWNyb3NlY29uZHMoNTAwMCkpOwogICAgICAgIHN0ZDo6Y291dCA8PCB0aC5qb2luYWJsZSgpIDw8IHN0ZDo6ZW5kbDsKICAgICAgICB0aC5qb2luKCk7CiAgICAgICAgc3RkOjpjb3V0IDw8IHRoLmpvaW5hYmxlKCkgPDwgc3RkOjplbmRsOwogICAgfWNhdGNoKHN0ZDo6ZXhjZXB0aW9uJiBlKXsKICAgICAgICBzdGQ6OmNvdXQgPDwgZS53aGF0KCkgPDwgc3RkOjplbmRsOwogICAgfQp9Cg==