Maybe. There's certainly ways to do it using less code. But no matter how you cook it, there's about two places where "stop and wait for the other thread" is unavoidable; I chose this approach because I thought it was the most obvious way to reflect the reality of the situation.