From b2491a2eed70e185bc085788a8a17b18e46b5547 Mon Sep 17 00:00:00 2001 From: Marcus Winter Date: Mon, 20 Jun 2016 14:41:05 +0200 Subject: [PATCH] base_c: added documentation for spurious wakeups with pthreads --- base_c/include/embb/base/c/condition_variable.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/base_c/include/embb/base/c/condition_variable.h b/base_c/include/embb/base/c/condition_variable.h index d707c2b..d89677d 100644 --- a/base_c/include/embb/base/c/condition_variable.h +++ b/base_c/include/embb/base/c/condition_variable.h @@ -110,6 +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. */ int embb_condition_wait( embb_condition_t* condition_var, @@ -131,6 +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. */ int embb_condition_wait_until( embb_condition_t* condition_var, @@ -154,6 +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. */ int embb_condition_wait_for( embb_condition_t* condition_var, -- libgit2 0.26.0