Module: xenomai-2.5
Branch: master
Commit: 3c63b1b772bb4d1c386956b1d5ed806a4c472eeb
URL:    
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=3c63b1b772bb4d1c386956b1d5ed806a4c472eeb

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Mar  7 14:24:54 2010 +0100

doc: add a warning about -EINTR return value for rt_cond_wait*

---

 ksrc/skins/native/cond.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ksrc/skins/native/cond.c b/ksrc/skins/native/cond.c
index 10727d1..1d0d2eb 100644
--- a/ksrc/skins/native/cond.c
+++ b/ksrc/skins/native/cond.c
@@ -514,7 +514,12 @@ static int rt_cond_wait_inner(RT_COND *cond, RT_MUTEX 
*mutex,
  * variable has been signaled.
  *
  * - -EINTR is returned if rt_task_unblock() has been called for the
- * waiting task before the condition variable has been signaled.
+ * waiting task, or a signal has been received before the condition
+ * variable has been signaled. Note that the condition variable may be
+ * signaled right after this interruption, so when using -EINTR, the
+ * code must not call rt_cond_wait() immediately again, or a condition
+ * signal may be missed. With respect to restartint rt_cond_wait(),
+ * -EINTR should be handled as if 0 had been returned.
  *
  * - -EWOULDBLOCK is returned if @a timeout equals TM_NONBLOCK.
  *
@@ -574,7 +579,12 @@ int rt_cond_wait(RT_COND *cond, RT_MUTEX *mutex, RTIME 
timeout)
  * before the condition variable is signaled.
  *
  * - -EINTR is returned if rt_task_unblock() has been called for the
- * waiting task before the condition variable has been signaled.
+ * waiting task before the condition variable has been signaled. Note
+ * that the condition variable may be signaled right after this
+ * interruption, so when using -EINTR, the code must not call
+ * rt_cond_wait() immediately again, or a condition signal may be
+ * missed. With respect to restartint rt_cond_wait(), -EINTR should be
+ * handled as if 0 had been returned.
  *
  * - -EWOULDBLOCK is returned if @a timeout equals TM_NONBLOCK.
  *


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to