Fix busywait on OSX