diff options
author | Chris Robinson <[email protected]> | 2018-11-29 13:34:06 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-29 13:34:06 -0800 |
commit | 0d2bbe17f2401feeae02972d927a8b72a4c28500 (patch) | |
tree | 22312af619b1dc8cb1889f39bd866a7182b565be | |
parent | c5d5d574e6312df70a181dff3bf23de15163dee9 (diff) |
Rename a function for consistency
-rw-r--r-- | common/threads.cpp | 6 | ||||
-rw-r--r-- | 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 |