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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri May 10 17:38:13 2013 +0200

copperplate/threadobj: keep the caller's lock around pthread_set_mode_np()

---

 lib/copperplate/threadobj.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index 2515569..da1c414 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -247,7 +247,7 @@ int threadobj_set_priority(struct threadobj *thobj, int 
prio) /* thobj->lock hel
 int threadobj_set_mode(int clrmask, int setmask, int *mode_r) /* current->lock 
held */
 {
        struct threadobj *current = threadobj_current();
-       int ret, __clrmask = 0, __setmask = 0;
+       int __clrmask = 0, __setmask = 0;
 
        __threadobj_check_locked(current);
 
@@ -266,11 +266,7 @@ int threadobj_set_mode(int clrmask, int setmask, int 
*mode_r) /* current->lock h
        else if (clrmask & __THREAD_M_CONFORMING)
                __clrmask |= PTHREAD_CONFORMING;
 
-       threadobj_unlock(current);
-       ret = pthread_set_mode_np(__clrmask, __setmask, mode_r);
-       threadobj_lock(current);
-
-       return ret;
+       return __bt(pthread_set_mode_np(__clrmask, __setmask, mode_r));
 }
 
 static int set_rr(struct threadobj *thobj, struct timespec *quantum)


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

Reply via email to