Finished task B and added a Barrier class to task A to handle syncing between threads.