Added changes to SimpleSemaphore.