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

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Fri Nov 12 13:46:29 2010 +0100

nucleus: Optimize setting of XNRESCHED

If xnsched_set_resched is called for a remote sched that already has
XNRESCHED set, we do not need to set the local XNRESCHED.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/nucleus/sched.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/nucleus/sched.h b/include/nucleus/sched.h
index afac8da..8e47c4f 100644
--- a/include/nucleus/sched.h
+++ b/include/nucleus/sched.h
@@ -184,10 +184,12 @@ static inline int xnsched_resched_p(struct xnsched *sched)
 /* Set specific resched flag into the local scheduler mask. */
 #define xnsched_set_resched(__sched__) do {                            \
   xnsched_t *current_sched = xnpod_current_sched();                    \
-  __setbits(current_sched->status, XNRESCHED);                         \
-  if (current_sched != (__sched__) && !xnsched_resched_p(__sched__)) { \
+  if (current_sched == (__sched__))                                    \
+      __setbits(current_sched->status, XNRESCHED);                     \
+  else if (!xnsched_resched_p(__sched__)) {                            \
       xnarch_cpu_set(xnsched_cpu(__sched__), current_sched->resched);  \
       __setbits((__sched__)->status, XNRESCHED);                       \
+      __setbits(current_sched->status, XNRESCHED);                     \
   }                                                                    \
 } while (0)
 


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

Reply via email to