File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ rust_kernel::rust_kernel(rust_srv *srv) :
17
17
_region(srv, true ),
18
18
_log(srv, NULL ),
19
19
srv(srv),
20
- live_tasks(0 ),
21
20
max_task_id(0 ),
22
21
rval(0 ),
23
22
max_sched_id(0 ),
@@ -173,7 +172,7 @@ rust_kernel::register_task(rust_task *task) {
173
172
scoped_lock with (task_lock);
174
173
task->id = max_task_id++;
175
174
task_table.put (task->id , task);
176
- new_live_tasks = ++live_tasks ;
175
+ new_live_tasks = task_table. count () ;
177
176
}
178
177
K (srv, task->id != INTPTR_MAX, " Hit the maximum task id" );
179
178
KLOG_ (" Registered task %" PRIdPTR, task->id );
@@ -187,7 +186,7 @@ rust_kernel::release_task_id(rust_task_id id) {
187
186
{
188
187
scoped_lock with (task_lock);
189
188
task_table.remove (id);
190
- new_live_tasks = --live_tasks ;
189
+ new_live_tasks = task_table. count () ;
191
190
}
192
191
KLOG_ (" Total outstanding tasks: %d" , new_live_tasks);
193
192
}
Original file line number Diff line number Diff line change @@ -24,12 +24,8 @@ class rust_kernel {
24
24
public:
25
25
rust_srv *srv;
26
26
private:
27
- // Protects live_tasks, max_task_id and task_table
27
+ // Protects max_task_id and task_table
28
28
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;
33
29
// The next task id
34
30
rust_task_id max_task_id;
35
31
hash_map<rust_task_id, rust_task *> task_table;
You can’t perform that action at this time.
0 commit comments