rt: Remove rust_task::can_schedule. Does nothing

This commit is contained in:
Brian Anderson
2012-02-02 16:30:22 -08:00
parent ed3a5ad5ad
commit 3978fbff8b
3 changed files with 5 additions and 20 deletions

View File

@@ -135,16 +135,10 @@ rust_scheduler::reap_dead_tasks(int id) {
for (size_t i = 0; i < dead_tasks_len; ++i) { for (size_t i = 0; i < dead_tasks_len; ++i) {
rust_task *task = dead_tasks_copy[i]; rust_task *task = dead_tasks_copy[i];
task->lock.lock(); task->lock.lock();
// Make sure this task isn't still running somewhere else...
if (task->can_schedule(id)) {
DLOG(this, task, DLOG(this, task,
"deleting unreferenced dead task %s @0x%" PRIxPTR, "deleting unreferenced dead task %s @0x%" PRIxPTR,
task->name, task); task->name, task);
task->lock.unlock(); task->lock.unlock();
} else {
task->lock.unlock();
dead_tasks_copy[i] = NULL;
}
} }
// Now grab the lock again and remove the tasks that were truly dead // Now grab the lock again and remove the tasks that were truly dead
@@ -192,11 +186,9 @@ rust_scheduler::schedule_task(int id) {
// Look around for a runnable task, starting at k. // Look around for a runnable task, starting at k.
for(size_t j = 0; j < running_tasks.length(); ++j) { for(size_t j = 0; j < running_tasks.length(); ++j) {
size_t i = (j + k) % running_tasks.length(); size_t i = (j + k) % running_tasks.length();
if (running_tasks[i]->can_schedule(id)) {
return (rust_task *)running_tasks[i]; return (rust_task *)running_tasks[i];
} }
} }
}
return NULL; return NULL;
} }

View File

@@ -623,11 +623,6 @@ rust_task::backtrace() {
#endif #endif
} }
bool rust_task::can_schedule(int id)
{
return true;
}
void * void *
rust_task::calloc(size_t size, const char *tag) { rust_task::calloc(size_t size, const char *tag) {
return local_region.calloc(size, tag); return local_region.calloc(size, tag);

View File

@@ -171,8 +171,6 @@ rust_task : public kernel_owned<rust_task>, rust_cond
frame_glue_fns *get_frame_glue_fns(uintptr_t fp); frame_glue_fns *get_frame_glue_fns(uintptr_t fp);
rust_crate_cache * get_crate_cache(); rust_crate_cache * get_crate_cache();
bool can_schedule(int worker);
void *calloc(size_t size, const char *tag); void *calloc(size_t size, const char *tag);
rust_port_id register_port(rust_port *port); rust_port_id register_port(rust_port *port);