]> Kevux Git Server - controller/commit
Progress: Continue setup for granting init program the ability to handle shutdown...
authorKevin Day <Kevin@kevux.org>
Sat, 2 Aug 2025 21:04:46 +0000 (16:04 -0500)
committerKevin Day <Kevin@kevux.org>
Sat, 2 Aug 2025 21:27:09 +0000 (16:27 -0500)
commitf17cb61f534f9ead8ee4effa858c86f9faf09dea
tree7807cfa640280382b5e9b170bcdf6833d8f46855
parent9151c36b8606bfc6f307f695a9fbb067294705d9
Progress: Continue setup for granting init program the ability to handle shutdown/reboot.

Replace the `fll_program_standard_set_up()` call with a custom signal setup call (`controller_signal_set_up()`).
Both the init and controller programs might as well use the same signals.
The controller program should reap its own children too, even if it is not an init program.

Use a thread condition signal to communicate to the clean up thread to perform zombie reaping.

Add missing delete in the init program.

Make sure all condition signals have proper checking around the success/failure of the condition listener.
Make sure all condition broadcasts lock before sending the signal and unlocks after.
This too must be checked for success.

Send a reap condition signal to wake up the clean up thread before cancelling the instance.

Add custom thread names using recently added thread naming FLL functions.
This should make analysis and observation of threads at runtime far easier.

The clean up thread is now located sooner in the process so that the zombie reaping may be processed during entry operations.

This should allow for the init/controller programs to receive the signals.
The init program is not yet written to do anything with them yet.

I tested the serial test like this:
```
controller -s data/data/controller/example/miscellaneous/ serial
```
I noticed that the interrupt signal before the wait is reached causes the program to exit.
Once the wait is reached and an interrupt is then sent then the exit process is started before exiting.
I remember being uncertain how to handle this and left that logic to future decisions.
As of now I believe that the exit process should always be called on interrupt.
This should be addressed ideally along with this shutdown/reboot handle or at the very least immediately after that.
24 files changed:
data/build/stand_alone/config.h
sources/c/program/controller/controller/main.c
sources/c/program/controller/init/main.c
sources/c/program/controller/init/signal.c
sources/c/program/controller/init/signal.h
sources/c/program/controller/main/common/define.h
sources/c/program/controller/main/common/string.c
sources/c/program/controller/main/common/string.h
sources/c/program/controller/main/common/type/lock.c
sources/c/program/controller/main/common/type/lock.h
sources/c/program/controller/main/controller.h
sources/c/program/controller/main/instance/wait.c
sources/c/program/controller/main/lock.c
sources/c/program/controller/main/process.c
sources/c/program/controller/main/rule/instance.c
sources/c/program/controller/main/rule/wait.c
sources/c/program/controller/main/signal.c
sources/c/program/controller/main/signal.h
sources/c/program/controller/main/thread/cleanup.c
sources/c/program/controller/main/thread/control.c
sources/c/program/controller/main/thread/entry.c
sources/c/program/controller/main/thread/instance.c
sources/c/program/controller/main/thread/rule.c
sources/c/program/controller/main/thread/signal.c