add semaphore implemented by mutex