Following situation: Thread A starts Thread B and should wait until Thread B has done its job. Thread B could start a new Thread C. If it is the case Thread A should wait for Thread B and Thread C.
I could implement it using two CountDownLatch, but I'm wondering if there is a better solution. I have looked to CyclicBarrier and Phaser, but I don't think they are appropriate in my case.