@@ -291,12 +291,20 @@ rust_kernel::set_exit_status(int code) {
291291}
292292
293293void
294- rust_kernel::register_task () {
295- KLOG_ (" Registering task" );
294+ rust_kernel::inc_live_count () {
296295 uintptr_t new_non_weak_tasks = sync::increment (non_weak_tasks);
297296 KLOG_ (" New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
298297}
299298
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+
300308void
301309rust_kernel::allow_scheduler_exit () {
302310 scoped_lock with (sched_lock);
@@ -315,31 +323,6 @@ rust_kernel::allow_scheduler_exit() {
315323 osmain_sched->allow_exit ();
316324}
317325
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-
343326void
344327rust_kernel::begin_shutdown () {
345328 {
0 commit comments