std::thread VS std::jthread std::jthread会在解构的时候判断线程是否还在运行joinable,如果还在运行则自动调用request_stop和join。 std::thread线程详解(1)