Modifications of the OSX Stack to work with 10.8 (Mountain Lion)

This patch replaces the deprecated API calls with semaphores and a GCD implementation.