fix for issue #2366

fix for semaphore error on mac os x #2366