Completed SemaphoreImpl and Semaphore classes