Skip to content

Commit 3978fbf

Browse files
committed
rt: Remove rust_task::can_schedule. Does nothing
1 parent ed3a5ad commit 3978fbf

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

src/rt/rust_scheduler.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,10 @@ rust_scheduler::reap_dead_tasks(int id) {
135135
for (size_t i = 0; i < dead_tasks_len; ++i) {
136136
rust_task *task = dead_tasks_copy[i];
137137
task->lock.lock();
138-
// Make sure this task isn't still running somewhere else...
139-
if (task->can_schedule(id)) {
140-
DLOG(this, task,
141-
"deleting unreferenced dead task %s @0x%" PRIxPTR,
142-
task->name, task);
143-
task->lock.unlock();
144-
} else {
145-
task->lock.unlock();
146-
dead_tasks_copy[i] = NULL;
147-
}
138+
DLOG(this, task,
139+
"deleting unreferenced dead task %s @0x%" PRIxPTR,
140+
task->name, task);
141+
task->lock.unlock();
148142
}
149143

150144
// Now grab the lock again and remove the tasks that were truly dead
@@ -192,9 +186,7 @@ rust_scheduler::schedule_task(int id) {
192186
// Look around for a runnable task, starting at k.
193187
for(size_t j = 0; j < running_tasks.length(); ++j) {
194188
size_t i = (j + k) % running_tasks.length();
195-
if (running_tasks[i]->can_schedule(id)) {
196-
return (rust_task *)running_tasks[i];
197-
}
189+
return (rust_task *)running_tasks[i];
198190
}
199191
}
200192
return NULL;

src/rt/rust_task.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -623,11 +623,6 @@ rust_task::backtrace() {
623623
#endif
624624
}
625625

626-
bool rust_task::can_schedule(int id)
627-
{
628-
return true;
629-
}
630-
631626
void *
632627
rust_task::calloc(size_t size, const char *tag) {
633628
return local_region.calloc(size, tag);

src/rt/rust_task.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ rust_task : public kernel_owned<rust_task>, rust_cond
171171
frame_glue_fns *get_frame_glue_fns(uintptr_t fp);
172172
rust_crate_cache * get_crate_cache();
173173

174-
bool can_schedule(int worker);
175-
176174
void *calloc(size_t size, const char *tag);
177175

178176
rust_port_id register_port(rust_port *port);

0 commit comments

Comments
 (0)