aboutsummaryrefslogtreecommitdiffstats
path: root/common/threads.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-29 13:34:06 -0800
committerChris Robinson <[email protected]>2018-11-29 13:34:06 -0800
commit0d2bbe17f2401feeae02972d927a8b72a4c28500 (patch)
tree22312af619b1dc8cb1889f39bd866a7182b565be /common/threads.cpp
parentc5d5d574e6312df70a181dff3bf23de15163dee9 (diff)
Rename a function for consistency
Diffstat (limited to 'common/threads.cpp')
-rw-r--r--common/threads.cpp6
1 files changed, 3 insertions, 3 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__ */