
#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;
    }
}
