diff --git a/common/Darwin/DarwinSemaphore.cpp b/common/Darwin/DarwinSemaphore.cpp index d3642e69bd..3d0c544abb 100644 --- a/common/Darwin/DarwinSemaphore.cpp +++ b/common/Darwin/DarwinSemaphore.cpp @@ -42,16 +42,10 @@ static void MACH_CHECK(kern_return_t mach_retval) { - switch (mach_retval) + if (mach_retval != KERN_SUCCESS) { - case KERN_SUCCESS: - break; - case KERN_ABORTED: // Awoken due reason unrelated to semaphore (e.g. pthread_cancel) - pthread_testcancel(); // Unlike sem_wait, mach semaphore ops aren't cancellation points - // fallthrough - default: - fprintf(stderr, "mach error: %s", mach_error_string(mach_retval)); - assert(mach_retval == KERN_SUCCESS); + fprintf(stderr, "mach error: %s", mach_error_string(mach_retval)); + assert(mach_retval == KERN_SUCCESS); } } diff --git a/common/Threading.h b/common/Threading.h index 908e41d023..57b4ba9187 100644 --- a/common/Threading.h +++ b/common/Threading.h @@ -235,7 +235,7 @@ namespace Threading class UserspaceSemaphore { KernelSemaphore m_sema; - std::atomic m_counter{0}; + std::atomic m_counter{0}; public: UserspaceSemaphore() = default;