diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2010-06-09 16:14:11 -0500 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2010-06-09 16:14:11 -0500 |
commit | 165e6bed506f9fddd7e9da8ad1f4c7f186e29b00 (patch) | |
tree | 6f6f94922b87d47f7111285a5f9482b41779c92b /src/kernel/scheduler.C | |
parent | e7a6ae9cc5b84abe63c7439005656ecc4beda8c1 (diff) | |
download | talos-hostboot-165e6bed506f9fddd7e9da8ad1f4c7f186e29b00.tar.gz talos-hostboot-165e6bed506f9fddd7e9da8ad1f4c7f186e29b00.zip |
Change scheduler to locked queue instead of stack-pair.
Diffstat (limited to 'src/kernel/scheduler.C')
-rw-r--r-- | src/kernel/scheduler.C | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/kernel/scheduler.C b/src/kernel/scheduler.C index b96dd7c7b..c7c26448c 100644 --- a/src/kernel/scheduler.C +++ b/src/kernel/scheduler.C @@ -6,7 +6,7 @@ void Scheduler::addTask(task_t* t) { if (iv_idleTask != t) { - iv_taskList[iv_direction ? 0 : 1].push(t); + iv_taskList.insert(t); } } @@ -17,16 +17,7 @@ void Scheduler::returnRunnable() void Scheduler::setNextRunnable() { - task_t* t = NULL; - - bool direction = iv_direction; - t = iv_taskList[direction ? 1 : 0].pop(); - - if (NULL == t) - { - t = iv_taskList[direction ? 0 : 1].pop(); - __sync_bool_compare_and_swap(&iv_direction, direction, !direction); - } + task_t* t = iv_taskList.remove(); if (NULL == t) { |