Module: xenomai-gch
Branch: for-forge
Commit: 687732440901b8cbdc1aca75f4c1bad5d8365901
URL:    
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=687732440901b8cbdc1aca75f4c1bad5d8365901

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Mon Dec  5 20:40:55 2011 +0100

cobalt: use xnsynch_wakeup_many_sleepers in cobalt_cond_deferred_signals

---

 kernel/cobalt/cond.h |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/kernel/cobalt/cond.h b/kernel/cobalt/cond.h
index 094502a..dc75f0d 100644
--- a/kernel/cobalt/cond.h
+++ b/kernel/cobalt/cond.h
@@ -71,25 +71,22 @@ typedef struct cobalt_cond {
 static inline int cobalt_cond_deferred_signals(struct cobalt_cond *cond)
 {
        unsigned long pending_signals;
-       int need_resched, i, sleepers;
+       int need_resched;
 
-       pending_signals = *(cond->pending_signals);
+       pending_signals = *cond->pending_signals;
 
        switch(pending_signals) {
        default:
-               sleepers = xnsynch_nsleepers(&cond->synchbase);
-               if (pending_signals > sleepers)
-                       pending_signals = sleepers;
-               need_resched = !!pending_signals;
-               for(i = 0; i < pending_signals; i++)
-                       xnsynch_wakeup_one_sleeper(&cond->synchbase);
                *cond->pending_signals = 0;
+               need_resched = xnsynch_wakeup_many_sleepers(&cond->synchbase,
+                                                           pending_signals);
                break;
 
        case ~0UL:
                need_resched =
                        xnsynch_flush(&cond->synchbase, 0) == XNSYNCH_RESCHED;
                *cond->pending_signals = 0;
+               break;
 
        case 0:
                need_resched = 0;


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

Reply via email to