Module: xenomai-head
Branch: master
Commit: 112062b86d06fa9056e6fbfb1cada24c253dec8c
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=112062b86d06fa9056e6fbfb1cada24c253dec8c

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Wed Aug 10 22:15:55 2011 +0200

native: fix condvars

They were broken since commit 167ad3c5f6d322d8e2cf310e837c3f54056d7ba6 with
recursive mutexes.

---

 ksrc/skins/native/syscall.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ksrc/skins/native/syscall.c b/ksrc/skins/native/syscall.c
index b21705a..71396e1 100644
--- a/ksrc/skins/native/syscall.c
+++ b/ksrc/skins/native/syscall.c
@@ -1832,11 +1832,11 @@ struct us_cond_data {
 static int __rt_cond_wait_prologue(struct pt_regs *regs)
 {
        RT_COND_PLACEHOLDER cph, mph;
+       unsigned dummy, *plockcnt;
        xntmode_t timeout_mode;
        struct us_cond_data d;
        int err, perr = 0;
        RT_MUTEX *mutex;
-       unsigned dummy;
        RT_COND *cond;
        RTIME timeout;
 
@@ -1869,16 +1869,19 @@ static int __rt_cond_wait_prologue(struct pt_regs *regs)
                                     sizeof(d)))
                return -EFAULT;
 
-       err = rt_cond_wait_prologue(cond, mutex, &dummy, timeout_mode, timeout);
+       plockcnt = &dummy;
 #else /* !CONFIG_XENO_FASTSYNCH */
-       err = rt_cond_wait_prologue(cond, mutex, &d.lockcnt, timeout_mode, 
timeout);
+       plockcnt = &d.lockcnt;
 #endif /* !CONFIG_XENO_FASTSYNCH */
+
+       err = rt_cond_wait_prologue(cond, mutex, plockcnt, timeout_mode, 
timeout);
+
        switch(err) {
        case 0:
        case -ETIMEDOUT:
        case -EIDRM:
                perr = d.err = err;
-               err = rt_cond_wait_epilogue(mutex, d.lockcnt);
+               err = rt_cond_wait_epilogue(mutex, *plockcnt);
                break;
 
        case -EINTR:


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

Reply via email to