aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/sched_gsn_edf.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-04-15 18:09:59 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2012-04-15 18:09:59 -0400
commitbb4922c968aa1a30fddd6ad9d0f750706c7b3b29 (patch)
tree9a92d6d810edda4e10f7cd8af6522c25e71273e2 /litmus/sched_gsn_edf.c
parentf4aef3b7d845324eb79a226d87f232dcd8867f3b (diff)
PAI::change_prio(): check work before locking
Diffstat (limited to 'litmus/sched_gsn_edf.c')
-rw-r--r--litmus/sched_gsn_edf.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c
index 37f7821dca50..37294111bb0c 100644
--- a/litmus/sched_gsn_edf.c
+++ b/litmus/sched_gsn_edf.c
@@ -723,15 +723,16 @@ static void gsnedf_change_prio_pai_tasklet(struct task_struct *old_prio,
723 struct tasklet_struct* step; 723 struct tasklet_struct* step;
724 unsigned long flags; 724 unsigned long flags;
725 725
726 raw_spin_lock_irqsave(&gsnedf_lock, flags); 726 if(gsnedf_pending_tasklets.head != NULL) {
727 727 raw_spin_lock_irqsave(&gsnedf_lock, flags);
728 for(step = gsnedf_pending_tasklets.head; step != NULL; step = step->next) { 728 for(step = gsnedf_pending_tasklets.head; step != NULL; step = step->next) {
729 if(step->owner == old_prio) { 729 if(step->owner == old_prio) {
730 TRACE("%s: Found tasklet to flush: %d\n", __FUNCTION__, step->owner->pid); 730 TRACE("%s: Found tasklet to change: %d\n", __FUNCTION__, step->owner->pid);
731 step->owner = new_prio; 731 step->owner = new_prio;
732 }
732 } 733 }
734 raw_spin_unlock_irqrestore(&gsnedf_lock, flags);
733 } 735 }
734 raw_spin_unlock_irqrestore(&gsnedf_lock, flags);
735} 736}
736 737
737#endif // end PAI 738#endif // end PAI