The core issue here is that we need to ensure `num_active_worker_threads_` is read before incrementing `done_workers`. See the comments added in this PR to explain why, and why the resulting code is race-free.
4.0 KiB
4.0 KiB