]> Kevux Git Server - controller/commit
Progress: Continue changes to locking.
authorKevin Day <Kevin@kevux.org>
Wed, 29 Oct 2025 11:24:07 +0000 (06:24 -0500)
committerKevin Day <Kevin@kevux.org>
Wed, 29 Oct 2025 11:40:19 +0000 (06:40 -0500)
commit14764eab94f956c107d8dd799385d5313aa6f2b1
tree0cd5edc159c18667ade2dff67876223b2059f5e3
parent857a9aca19d8763d70178a7d3ded210460dcf81c
Progress: Continue changes to locking.

Refactor `instance.lock` to `instance.use` to reduce the ambiguity regarding a lock named "lock".

Remove the `id` off of the instance.
This is not needed and removing it reduces the need for some locking.
The thread itself is now the "id" so `id_thread` is now renamed to just `thread`.
The `controller_instance_find()` function can now just get the instance pointer.

Add a "time" controller lock check flag.
Use this to designate expecting to return `F_time` on time outs.

Add additional documentation regarding locks.

Reduce uses of locking where possible by re-organizing code.
The `controller_instance_prepare()` function, in particular, has the the code changed to reduce how long the lock is held.
This is possible because the `controller_instance_find()` now gets the instance pointer rather than an identifier.
The `controller_instance_prepare()` function allocates the instance pointer independent of the array.
This allows for the write lock on instance to be only used when assigning to the array.
The instance must therefore be immediately freed on any error because it is not assigned to an array and cannot be auto-deallocated.

Add missing locks to areas where the locks should be, such as a read lock while reading the dependency rule status.

Make sure `instance.active` lock is set before calling `instance.use` locks (there may be more work needed regarding this).
Try to reduce how long `instance.use` are held (there may be more work needed regarding this).
24 files changed:
sources/c/program/controller/main/common/define.h
sources/c/program/controller/main/common/enumeration/instance.h
sources/c/program/controller/main/common/type/instance.c
sources/c/program/controller/main/common/type/instance.h
sources/c/program/controller/main/entry/process.c
sources/c/program/controller/main/instance.c
sources/c/program/controller/main/instance.h
sources/c/program/controller/main/instance/prepare.c
sources/c/program/controller/main/instance/prepare.h
sources/c/program/controller/main/instance/wait.c
sources/c/program/controller/main/instance/wait.h
sources/c/program/controller/main/lock.c
sources/c/program/controller/main/lock.h
sources/c/program/controller/main/mutex.c
sources/c/program/controller/main/mutex.h
sources/c/program/controller/main/print/error/lock.c
sources/c/program/controller/main/process.c
sources/c/program/controller/main/rule/execute.c
sources/c/program/controller/main/rule/execute.h
sources/c/program/controller/main/rule/instance.c
sources/c/program/controller/main/rule/instance.h
sources/c/program/controller/main/rule/wait.c
sources/c/program/controller/main/thread/cleanup.c
sources/c/program/controller/main/thread/instance.c