about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-02-02 16:24:32 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-02 18:10:24 -0800
commit8693fcc2d78c02670d69eb7be772898b41281db7 (patch)
treee17cbc9c8458f9e8b487f9c8a976ee9441b752e6 /src/rt
parent7f2980b7498453019aa349aae9c94b90b920e2a6 (diff)
downloadrust-8693fcc2d78c02670d69eb7be772898b41281db7.tar.gz
rust-8693fcc2d78c02670d69eb7be772898b41281db7.zip
rt: Remove yield timers
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_builtin.cpp1
-rw-r--r--src/rt/rust_internal.h1
-rw-r--r--src/rt/rust_scheduler.cpp6
-rw-r--r--src/rt/rust_task.cpp5
-rw-r--r--src/rt/rust_task.h3
5 files changed, 4 insertions, 12 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index ea2e8de256c..c4c9927b3f7 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 <sys/time.h>
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h
index ef1ad4b25a9..6fb15a2d081 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 d4aaa9edbcd..397c321a4cc 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 4acef16a209..017de8dca1b 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 418eb54cab5..63145153865 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -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