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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Jul 19 21:34:21 2009 +0200

nucleus: fix potential init race of the main pod

---

 ksrc/nucleus/pod.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c
index ef0af42..35e76ec 100644
--- a/ksrc/nucleus/pod.c
+++ b/ksrc/nucleus/pod.c
@@ -355,7 +355,8 @@ int xnpod_init(void)
 
        xnlock_get_irqsave(&nklock, s);
 
-       if (xnpod_active_p()) {
+       pod = &nkpod_struct;
+       if (pod->refcnt > 0) {
                /*
                 * Another skin has initialized the global pod
                 * already; just increment the reference count.
@@ -365,7 +366,6 @@ int xnpod_init(void)
                return 0;
        }
 
-       pod = &nkpod_struct;
        pod->status = 0;
        pod->refcnt = 1;
        initq(&pod->threadq);


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

Reply via email to