Create Barrier abstract class. Added Barrier implementation using fewer semaphores.