From 7149bbbe08d937df5234633e6a61c9e9f7394934 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 11 Jul 2024 22:33:15 -0500 Subject: [PATCH] Bugfix: Incorrect thread unlock in controller_rule_process(). When the lock is grabbed but a failure occurs an if condition handles that case. After that block is a second block that then attempts to unlock that same lock. Given that the lock failed, this lock cannot be in a locked state. --- level_3/controller/c/rule/private-rule.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/level_3/controller/c/rule/private-rule.c b/level_3/controller/c/rule/private-rule.c index 38d1875..1729632 100644 --- a/level_3/controller/c/rule/private-rule.c +++ b/level_3/controller/c/rule/private-rule.c @@ -2654,12 +2654,7 @@ extern "C" { return status; } - status = F_true; - } - - if (status == F_true) { - found = F_true; - + status = found = F_true; dependency = global.thread->processs.array[id_dependency]; status_lock = controller_lock_read_process(process, global.thread, &dependency->active); @@ -2689,9 +2684,6 @@ extern "C" { } } } - else { - f_thread_unlock(&global.thread->lock.process); - } if (status != F_true) { found = F_false; -- 1.8.3.1