Set the default value for the thread count in the construct of Barrier
to be 0.
Add RegisterThread() to Barrier to increase the thread count by 1.
Add setEmpty() to Barrier to reset thread count to 0.