Skip to content

Commit 5df44bd

Browse files
committed
rt: Remove rust_kernel::live_tasks. Unused
1 parent 3cec2d6 commit 5df44bd

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/rt/rust_kernel.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ rust_kernel::rust_kernel(rust_srv *srv) :
1717
_region(srv, true),
1818
_log(srv, NULL),
1919
srv(srv),
20-
live_tasks(0),
2120
max_task_id(0),
2221
rval(0),
2322
max_sched_id(0),
@@ -173,7 +172,7 @@ rust_kernel::register_task(rust_task *task) {
173172
scoped_lock with(task_lock);
174173
task->id = max_task_id++;
175174
task_table.put(task->id, task);
176-
new_live_tasks = ++live_tasks;
175+
new_live_tasks = task_table.count();
177176
}
178177
K(srv, task->id != INTPTR_MAX, "Hit the maximum task id");
179178
KLOG_("Registered task %" PRIdPTR, task->id);
@@ -187,7 +186,7 @@ rust_kernel::release_task_id(rust_task_id id) {
187186
{
188187
scoped_lock with(task_lock);
189188
task_table.remove(id);
190-
new_live_tasks = --live_tasks;
189+
new_live_tasks = task_table.count();
191190
}
192191
KLOG_("Total outstanding tasks: %d", new_live_tasks);
193192
}

src/rt/rust_kernel.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ class rust_kernel {
2424
public:
2525
rust_srv *srv;
2626
private:
27-
// Protects live_tasks, max_task_id and task_table
27+
// Protects max_task_id and task_table
2828
lock_and_signal task_lock;
29-
// Tracks the number of tasks that are being managed by
30-
// schedulers. When this hits 0 we will tell all schedulers
31-
// to exit.
32-
uintptr_t live_tasks;
3329
// The next task id
3430
rust_task_id max_task_id;
3531
hash_map<rust_task_id, rust_task *> task_table;

0 commit comments

Comments
 (0)