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

Author: Kim De Mey <kim.de...@gmail.com>
Date:   Mon Oct 21 16:09:00 2013 +0200

copperplate/threadobj: do not set __THREAD_S_SAFE when not needed

Do not set __THREAD_S_SAFE for thobj->status when the priority
of the task is lower than the priority of the current task.

Signed-off-by: Kim De Mey <kim.de...@gmail.com>

---

 lib/copperplate/threadobj.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index 8aff287..a283b22 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -926,7 +926,7 @@ int threadobj_start(struct threadobj *thobj)        /* 
thobj->lock held. */
        if (thobj->status & __THREAD_S_STARTED)
                return 0;
 
-       thobj->status |= __THREAD_S_STARTED|__THREAD_S_SAFE;
+       thobj->status |= __THREAD_S_STARTED;
        __RT(pthread_cond_signal(&thobj->barrier));
 
        if (current && thobj->priority <= current->priority)
@@ -943,6 +943,7 @@ int threadobj_start(struct threadobj *thobj)        /* 
thobj->lock held. */
         */
        pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate);
 
+       thobj->status |= __THREAD_S_SAFE;
        wait_on_barrier(thobj, __THREAD_S_ACTIVE);
        thobj->status &= ~__THREAD_S_SAFE;
 


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

Reply via email to