aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-07-27 18:16:26 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-07-27 18:16:26 -0400
commitd4ef04e8b213df75e567ae4a78ba510d0d3e492a (patch)
tree461129f8e594cf2368802eb9bd703c5565ba122f /litmus
parent76f8ba0ab085c5f5c4121462a0a237e205c3e51c (diff)
Litmus core: support tie-breaking in priority queue
We'd like to have consistent deadline tie-breaking in priority-ordered wait queues, too.
Diffstat (limited to 'litmus')
-rw-r--r--litmus/locking.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/litmus/locking.c b/litmus/locking.c
index 6ceaf2e9d0a2..2db2c2813c0b 100644
--- a/litmus/locking.c
+++ b/litmus/locking.c
@@ -152,7 +152,9 @@ unsigned int __add_wait_queue_prio_exclusive(
152 prio_wait_queue_t* queued = list_entry(pos, prio_wait_queue_t, 152 prio_wait_queue_t* queued = list_entry(pos, prio_wait_queue_t,
153 wq.task_list); 153 wq.task_list);
154 154
155 if (unlikely(lt_before(new->priority, queued->priority))) { 155 if (unlikely(lt_before(new->priority, queued->priority) ||
156 (new->priority == queued->priority &&
157 new->tie_breaker < queued->tie_breaker))) {
156 /* pos is not less than new, thus insert here */ 158 /* pos is not less than new, thus insert here */
157 __list_add(&new->wq.task_list, pos->prev, pos); 159 __list_add(&new->wq.task_list, pos->prev, pos);
158 goto out; 160 goto out;