Added a validity flag to the semaphores. and it builds. yay.