Finish semaphore write.c