There's a much more common paradigm for waiting on a thread called "join". It's not a necessary change, but would greatly increase the readability/maintainability of the code.