From 0d2bbe17f2401feeae02972d927a8b72a4c28500 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 29 Nov 2018 13:34:06 -0800 Subject: Rename a function for consistency --- common/threads.cpp | 6 +++--- common/threads.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/threads.cpp b/common/threads.cpp index eaf2cbbc..69989ae4 100644 --- a/common/threads.cpp +++ b/common/threads.cpp @@ -79,7 +79,7 @@ void semaphore::post() void semaphore::wait() noexcept { WaitForSingleObject(mSem, INFINITE); } -int semaphore::trywait() noexcept +bool semaphore::try_wait() noexcept { return WaitForSingleObject(mSem, 0) == WAIT_OBJECT_0; } } // namespace al @@ -129,7 +129,7 @@ void semaphore::post() void semaphore::wait() noexcept { dispatch_semaphore_wait(mSem, DISPATCH_TIME_FOREVER); } -int semaphore::trywait() noexcept +bool semaphore::try_wait() noexcept { return dispatch_semaphore_wait(mSem, DISPATCH_TIME_NOW) == 0; } #else /* !__APPLE__ */ @@ -155,7 +155,7 @@ void semaphore::wait() noexcept } } -int semaphore::trywait() noexcept +bool semaphore::try_wait() noexcept { return sem_trywait(&mSem) == 0; } #endif /* __APPLE__ */ diff --git a/common/threads.h b/common/threads.h index 7eb2d608..8a640390 100644 --- a/common/threads.h +++ b/common/threads.h @@ -47,7 +47,7 @@ public: void post(); void wait() noexcept; - int trywait() noexcept; + bool try_wait() noexcept; }; } // namespace al -- cgit v1.2.3