Thread synchronization using semaphore (Linux)