Implement Semaphore Using C