From 48d2d0d17ae552fe7f11a9b68462369e210e8752 Mon Sep 17 00:00:00 2001 From: Marcus Winter Date: Tue, 21 Jun 2016 13:30:57 +0200 Subject: [PATCH] base: changed note on spurios wakeups as per request --- base_c/include/embb/base/c/condition_variable.h | 18 +++++++++--------- base_cpp/include/embb/base/condition_variable.h | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/base_c/include/embb/base/c/condition_variable.h b/base_c/include/embb/base/c/condition_variable.h index d89677d..9d247b5 100644 --- a/base_c/include/embb/base/c/condition_variable.h +++ b/base_c/include/embb/base/c/condition_variable.h @@ -110,9 +110,9 @@ int embb_condition_notify_all( * \threadsafe * \see embb_condition_notify_one(), embb_condition_notify_all(), * embb_condition_wait_until(), embb_condition_wait_for() - * \note When pthreads is used as the underlying library, this function may issue - * spurious wake ups to a waiting thread. Therefore it is recommended to - * use a loop checking the condition after a wakeup. + * \note It is strongly recommended checking the condition in a loop in order + * to deal with spurious wakeups and situations where another thread has + * locked the mutex between notification and wakeup. */ int embb_condition_wait( embb_condition_t* condition_var, @@ -134,9 +134,9 @@ int embb_condition_wait( * \threadsafe * \see embb_condition_notify_one(), embb_condition_notify_all(), * embb_condition_wait(), embb_condition_wait_for() - * \note When pthreads is used as the underlying library, this function may issue - * spurious wake ups to a waiting thread. Therefore it is recommended to - * use a loop checking the condition after a wakeup. + * \note It is strongly recommended checking the condition in a loop in order + * to deal with spurious wakeups and situations where another thread has + * locked the mutex between notification and wakeup. */ int embb_condition_wait_until( embb_condition_t* condition_var, @@ -160,9 +160,9 @@ int embb_condition_wait_until( * \threadsafe * \see embb_condition_notify_one(), embb_condition_notify_all(), * embb_condition_wait(), embb_condition_wait_until() - * \note When pthreads is used as the underlying library, this function may issue - * spurious wake ups to a waiting thread. Therefore it is recommended to - * use a loop checking the condition after a wakeup. + * \note It is strongly recommended checking the condition in a loop in order + * to deal with spurious wakeups and situations where another thread has + * locked the mutex between notification and wakeup. */ int embb_condition_wait_for( embb_condition_t* condition_var, diff --git a/base_cpp/include/embb/base/condition_variable.h b/base_cpp/include/embb/base/condition_variable.h index 5e535f2..42e6c20 100644 --- a/base_cpp/include/embb/base/condition_variable.h +++ b/base_cpp/include/embb/base/condition_variable.h @@ -100,9 +100,9 @@ class ConditionVariable { * * \see NotifyOne(), NotifyAll() * - * \note When Pthreads is used as the underlying library, this function may issue - * spurious wake ups to a waiting thread. Therefore it is recommended to - * use a loop checking the condition after a wakeup. + * \note It is strongly recommended checking the condition in a loop in order + * to deal with spurious wakeups and situations where another thread has + * locked the mutex between notification and wakeup. */ void Wait( UniqueLock& lock @@ -123,9 +123,9 @@ class ConditionVariable { * * \threadsafe * - * \note When Pthreads is used as the underlying library, this function may issue - * spurious wake ups to a waiting thread. Therefore it is recommended to - * use a loop checking the condition after a wakeup. + * \note It is strongly recommended checking the condition in a loop in order + * to deal with spurious wakeups and situations where another thread has + * locked the mutex between notification and wakeup. */ bool WaitUntil( UniqueLock& lock, @@ -150,9 +150,9 @@ class ConditionVariable { * * \tparam Tick Type of tick of the duration. See Duration. * - * \note When Pthreads is used as the underlying library, this function may issue - * spurious wake ups to a waiting thread. Therefore it is recommended to - * use a loop checking the condition after a wakeup. + * \note It is strongly recommended checking the condition in a loop in order + * to deal with spurious wakeups and situations where another thread has + * locked the mutex between notification and wakeup. */ template bool WaitFor( -- libgit2 0.26.0