fixed semaphore mutex and barrier