]> Kevux Git Server - fll/commit
Progress: controller program thread support.
authorKevin Day <thekevinday@gmail.com>
Thu, 21 Jan 2021 04:43:49 +0000 (22:43 -0600)
committerKevin Day <thekevinday@gmail.com>
Thu, 21 Jan 2021 04:43:49 +0000 (22:43 -0600)
commit156954deceea1ad77237426deae4ebab7a110ae4
treea13a8005f93adeb4a03fc3fa5d6cc78ea821284b
parentb09c02670f8d500b1650bb2aa5685c699c6fa34f
Progress: controller program thread support.

This is the initial pass at getting the thread support implemented.
There were several necessary changes in how the cache is defined and used.

This is very much incomplete.
All of the printf functions after a certain point need to be protected by a print mutex.

I need to figure out if and how to handle child processes from an execv() call from inside a thread.
Ideally it needs to gracefully exit and cleanup resources in the child process.

Just like with the child process and execv() the signal/interrupt handling needs to be handled in a way that gracefully exits as appropriate.
Prior to adding thread support, I added signal support and tested that it works.
These interrupt signals work but have not been tested or reviewed now that the threading is added.

A quick execution of this code shows that there are invalid reads (and therefore segfaults).
I need to pick up here and make sure all of the resources are being properly managed.
14 files changed:
level_3/controller/c/controller.c
level_3/controller/c/private-common.c [new file with mode: 0644]
level_3/controller/c/private-common.h
level_3/controller/c/private-control.c
level_3/controller/c/private-controller.c
level_3/controller/c/private-controller.h
level_3/controller/c/private-entry.c
level_3/controller/c/private-entry.h
level_3/controller/c/private-rule.c
level_3/controller/c/private-rule.h
level_3/controller/c/private-thread.c [new file with mode: 0644]
level_3/controller/c/private-thread.h [new file with mode: 0644]
level_3/controller/data/build/settings
level_3/fake/c/main.c