Henry Wong wrote:
Just by guessing at the code... Perhaps, it is not possible to start cleaning the pen until all animals have been removed? Otherwise the animals may be hurt? Perhaps, it is not possible to add animals to the pen until the cleaning process have been completed? Again, otherwise the animals may be hurt?
It's a lion pen. I'd be more concerned with the people cleaning the pen to be hurt!
A. Aka wrote:I tried with one CyclicBarrier and it works, so I was wondering why it was necessary to have 2 distinct CyclicBarriers
How do you know? With threads, it is easy to have something happen by coincidence and appear to work.