]> Kevux Git Server - controller/commit
Update: Improve clean up function.
authorKevin Day <Kevin@kevux.org>
Thu, 6 Nov 2025 06:26:29 +0000 (00:26 -0600)
committerKevin Day <Kevin@kevux.org>
Thu, 6 Nov 2025 06:28:51 +0000 (00:28 -0600)
commit6fadd224fd15705971f5e0bd1496f3b334209334
tree31fe5832465f6ca58156218fbbd9252ced343504
parent9a3a487b3c3f986b987b2f4c29f2c60351c1d153
Update: Improve clean up function.

Add additional time check to reduce excessive instance clean up operations.
The reap condition gets triggered before the delay is resolved can result in constant clean up operations.
This increases the number of locks being grabbed just to check things.
A large number of processes can exit causes a large number of conditions to be triggered.
Avoid this by honoring the delay.
Only the reap gets performed if the delay is not yet expired.

Move the main instance clean up logic into a separate function `controller_thread_cleanup_perform()`.

Optimize the `while (F_false)` condition to not have a hard coded boolean in its condition.
sources/c/program/controller/main/thread/cleanup.c
sources/c/program/controller/main/thread/cleanup.h