@@ -291,12 +291,20 @@ rust_kernel::set_exit_status(int code) {
291
291
}
292
292
293
293
void
294
- rust_kernel::register_task () {
295
- KLOG_ (" Registering task" );
294
+ rust_kernel::inc_live_count () {
296
295
uintptr_t new_non_weak_tasks = sync ::increment (non_weak_tasks);
297
296
KLOG_ (" New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
298
297
}
299
298
299
+ void
300
+ rust_kernel::dec_live_count () {
301
+ uintptr_t new_non_weak_tasks = sync ::decrement (non_weak_tasks);
302
+ KLOG_ (" New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
303
+ if (new_non_weak_tasks == 0 ) {
304
+ begin_shutdown ();
305
+ }
306
+ }
307
+
300
308
void
301
309
rust_kernel::allow_scheduler_exit () {
302
310
scoped_lock with (sched_lock);
@@ -315,31 +323,6 @@ rust_kernel::allow_scheduler_exit() {
315
323
osmain_sched->allow_exit ();
316
324
}
317
325
318
- void
319
- rust_kernel::unregister_task () {
320
- KLOG_ (" Unregistering task" );
321
- uintptr_t new_non_weak_tasks = sync ::decrement (non_weak_tasks);
322
- KLOG_ (" New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
323
- if (new_non_weak_tasks == 0 ) {
324
- begin_shutdown ();
325
- }
326
- }
327
-
328
- void
329
- rust_kernel::inc_weak_task_count () {
330
- uintptr_t new_non_weak_tasks = sync ::decrement (non_weak_tasks);
331
- KLOG_ (" New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
332
- if (new_non_weak_tasks == 0 ) {
333
- begin_shutdown ();
334
- }
335
- }
336
-
337
- void
338
- rust_kernel::dec_weak_task_count () {
339
- uintptr_t new_non_weak_tasks = sync ::increment (non_weak_tasks);
340
- KLOG_ (" New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
341
- }
342
-
343
326
void
344
327
rust_kernel::begin_shutdown () {
345
328
{
0 commit comments