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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu May  8 15:13:46 2014 +0200

copperplate/threadobj: drop useless check from round-robin handler

Only threads currently undergoing the RR scheduling will receive
SIGRRB, so there is no point in re-checking this fact in the
handler. Besides, such test was racy, since thobj->status must be
accessed under lock.

---

 lib/copperplate/threadobj.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index 8508444..7a7f970 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -396,15 +396,12 @@ static void unblock_sighandler(int sig)
 
 static void roundrobin_handler(int sig)
 {
-       struct threadobj *current = threadobj_current();
-
        /*
         * We do manual round-robin over SCHED_FIFO(RT) to allow for
         * multiple arbitrary time slices (i.e. vs the kernel
         * pre-defined and fixed one).
         */
-       if (current && (current->status & __THREAD_S_RR) != 0)
-               sched_yield();
+       sched_yield();
 }
 
 static inline void pkg_init_corespec(void)


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

Reply via email to