rt: Remove yield timers

This commit is contained in:
Brian Anderson 2012-02-02 16:24:32 -08:00
parent 7f2980b749
commit 8693fcc2d7
5 changed files with 4 additions and 12 deletions

View File

@ -4,6 +4,7 @@
#include "rust_scheduler.h"
#include "rust_task.h"
#include "rust_util.h"
#include "sync/timer.h"
#if !defined(__WIN32__)
#include <sys/time.h>

View File

@ -47,7 +47,6 @@ extern "C" {
#include "util/synchronized_indexed_list.h"
#include "util/hash_map.h"
#include "sync/sync.h"
#include "sync/timer.h"
#include "sync/lock_and_signal.h"
#include "sync/lock_free_queue.h"

View File

@ -207,11 +207,9 @@ rust_scheduler::log_state() {
if (!running_tasks.is_empty()) {
log(NULL, log_debug, "running tasks:");
for (size_t i = 0; i < running_tasks.length(); i++) {
log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR
" remaining: %" PRId64 " us",
log(NULL, log_debug, "\t task: %s @0x%" PRIxPTR,
running_tasks[i]->name,
running_tasks[i],
running_tasks[i]->yield_timer.remaining_us());
running_tasks[i]);
}
}

View File

@ -395,7 +395,6 @@ rust_task::start(spawn_fn spawnee_fn,
void rust_task::start()
{
yield_timer.reset_us(0);
transition(&sched->newborn_tasks, &sched->running_tasks);
sched->lock.signal();
}
@ -407,8 +406,6 @@ rust_task::yield(size_t time_in_us, bool *killed) {
*killed = true;
}
yield_timer.reset_us(time_in_us);
// Return to the scheduler.
ctx.next->swap(ctx);
@ -630,7 +627,7 @@ rust_task::backtrace() {
bool rust_task::can_schedule(int id)
{
return yield_timer.has_timed_out() &&
return
running_on == -1 &&
(pinned_on == -1 || pinned_on == id);
}

View File

@ -90,9 +90,6 @@ rust_task : public kernel_owned<rust_task>, rust_cond
rust_port_id next_port_id;
// Keeps track of the last time this task yielded.
timer yield_timer;
// Rendezvous pointer for receiving data when blocked on a port. If we're
// trying to read data and no data is available on any incoming channel,
// we block on the port, and yield control to the scheduler. Since, we