added semaphores.c and added the foundation for task 3