added semaphore definitions
fixed sempahore definitions