save thread in object member (e.g. unique_ptr to check in dtor is it created) to .join() it in dtor