The goal is to wait for `wait_time` for all the threads to complete.

The outcome you describe only happens in the case where the timeout is reached on the first thread. This is unlikely. If the timeout is 10 seconds, and threads usually take 5 seconds to complete then if there are four threads and they complete  in 5s, 6s, 4s, and the last one hangs, we'd end up waiting `5 + 1 + 0 + 10 => 16s` instead of the desired `10s`. To accomplish that, we should only wait for the remaining 4 seconds on the last two threads. Worse, if all the threads hang, and we just wait for `wait_time` on each, we'd end up waiting `40s`.

If you have a more clear way to express this same logic, let me know.