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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Mar 24 14:39:28 2010 +0100

rtipc/bufp: prevent I/O waiters from missing a pulse

---

 ksrc/drivers/ipc/bufp.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ksrc/drivers/ipc/bufp.c b/ksrc/drivers/ipc/bufp.c
index 88200ab..04b3209 100644
--- a/ksrc/drivers/ipc/bufp.c
+++ b/ksrc/drivers/ipc/bufp.c
@@ -273,10 +273,12 @@ redo:
                wait.len = len;
                wait.sk = sk;
                rtipc_prepare_wait(&wait.wc);
-               rtipc_leave_atomic(wait.lockctx);
+               /*
+                * Keep the nucleus lock across the wait call, so that
+                * we don't miss a pulse.
+                */
                ret = rtdm_event_timedwait(&sk->i_event,
                                           sk->rx_timeout, &toseq);
-               rtipc_enter_atomic(wait.lockctx);
                rtipc_finish_wait(&wait.wc, __bufp_cleanup_handler);
 
                if (unlikely(ret))
@@ -504,10 +506,12 @@ redo:
                wait.len = len;
                wait.sk = rsk;
                rtipc_prepare_wait(&wait.wc);
-               rtipc_leave_atomic(wait.lockctx);
+               /*
+                * Keep the nucleus lock across the wait call, so that
+                * we don't miss a pulse.
+                */
                ret = rtdm_event_timedwait(&rsk->o_event,
                                           sk->tx_timeout, &toseq);
-               rtipc_enter_atomic(wait.lockctx);
                rtipc_finish_wait(&wait.wc, __bufp_cleanup_handler);
                if (unlikely(ret))
                        break;


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

Reply via email to