include <thread> header only when needed