This is an instance of unspecified behavior leading to a deadlock, as thread_local std::jthread attempts to join after the thread function has exited, possibly at a point where the thread shutdown sequence is already ongoing.