Module: xenomai-forge
Branch: master
Commit: 49a3f1629f480f1ec248f3dacf07972966b36ec0
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=49a3f1629f480f1ec248f3dacf07972966b36ec0

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Jun  5 15:44:44 2013 +0200

psos/event: protect against race between psos_event_once() vs tm_cancel()

---

 lib/psos/tm.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/psos/tm.c b/lib/psos/tm.c
index acc79b7..d965292 100644
--- a/lib/psos/tm.c
+++ b/lib/psos/tm.c
@@ -73,11 +73,12 @@ static void post_event_once(struct timerobj *tmobj)
        struct service svc;
        int ret;
 
-       ev_send(tm->tid, tm->events);
        COPPERPLATE_PROTECT(svc);
        ret = timerobj_lock(&tm->tmobj);
-       if (ret == 0)
+       if (ret == 0) {
+               ev_send(tm->tid, tm->events);
                delete_timer(tm);
+       }
        COPPERPLATE_UNPROTECT(svc);
 }
 


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

Reply via email to