diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index ea2e8de256c4..c4c9927b3f77 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -4,6 +4,7 @@ #include "rust_scheduler.h" #include "rust_task.h" #include "rust_util.h" +#include "sync/timer.h" #if !defined(__WIN32__) #include diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h index ef1ad4b25a9d..6fb15a2d0810 100644 --- a/src/rt/rust_internal.h +++ b/src/rt/rust_internal.h @@ -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" diff --git a/src/rt/rust_scheduler.cpp b/src/rt/rust_scheduler.cpp index d4aaa9edbcd9..397c321a4cc1 100644 --- a/src/rt/rust_scheduler.cpp +++ b/src/rt/rust_scheduler.cpp @@ -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]); } } diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 4acef16a2090..017de8dca1b1 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -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); } diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 418eb54cab5b..631451538652 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -90,9 +90,6 @@ rust_task : public kernel_owned, 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