Module: xenomai-forge
Branch: next
Commit: 36fcd51486e9fd713ed8327ee5e32e8517f8abd6
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=36fcd51486e9fd713ed8327ee5e32e8517f8abd6

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Apr 23 12:39:59 2014 +0200

alchemy/task: protect cancel-unsafe section

---

 lib/alchemy/task.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/alchemy/task.c b/lib/alchemy/task.c
index 254aa5f..ebc8987 100644
--- a/lib/alchemy/task.c
+++ b/lib/alchemy/task.c
@@ -906,6 +906,7 @@ int rt_task_wait_period(unsigned long *overruns_r)
 int rt_task_sleep_until(RTIME date)
 {
        struct timespec ts;
+       struct service svc;
        ticks_t now;
 
        if (!threadobj_current_p())
@@ -917,7 +918,9 @@ int rt_task_sleep_until(RTIME date)
                clockobj_get_time(&alchemy_clock, &now, NULL);
                if (date <= now)
                        return -ETIMEDOUT;
+               CANCEL_DEFER(svc);
                clockobj_ticks_to_timespec(&alchemy_clock, date, &ts);
+               CANCEL_RESTORE(svc);
        }
 
        return threadobj_sleep(&ts);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to