Module: xenomai-rpm
Branch: for-upstream
Commit: d47c7faf06f8972c00bec2d3389e0613cefca8ef
URL:    
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=d47c7faf06f8972c00bec2d3389e0613cefca8ef

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu May  5 15:38:08 2011 +0200

native: fix pre-locking of MPS send queue

---

 ksrc/skins/native/task.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ksrc/skins/native/task.c b/ksrc/skins/native/task.c
index ffacc99..b822fd0 100644
--- a/ksrc/skins/native/task.c
+++ b/ksrc/skins/native/task.c
@@ -312,7 +312,6 @@ int rt_task_create(RT_TASK *task,
         * indefinitely, without raising the resource count though.
         */
        xnsynch_init(&task->msendq, XNSYNCH_PIP, fastlock);
-       xnsynch_fast_acquire(fastlock, xnthread_handle(&task->thread_base));
        xnsynch_set_owner(&task->msendq, &task->thread_base);
        task->flowgen = 0;
 #endif /* CONFIG_XENO_OPT_NATIVE_MPS */
@@ -327,8 +326,13 @@ int rt_task_create(RT_TASK *task,
           half-baked objects... */
 
        err = xnthread_register(&task->thread_base, name ? task->rname : "");
-       if (err)
+       if (err) {
+#if defined(CONFIG_XENO_OPT_NATIVE_MPS) && defined(CONFIG_XENO_FASTSYNCH)
+               xnheap_free(&xnsys_ppd_get(0)->sem_heap, fastlock);
+#endif
                xnpod_delete_thread(&task->thread_base);
+       } else
+               xnsynch_fast_acquire(fastlock, 
xnthread_handle(&task->thread_base));
 
        return err;
 }


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

Reply via email to