]> Kevux Git Server - fll/commitdiff
Bugfix: Don't assign enabled variable on lock failure to avoid potential race conditi...
authorKevin Day <Kevin@kevux.org>
Tue, 9 Jul 2024 03:57:46 +0000 (22:57 -0500)
committerKevin Day <Kevin@kevux.org>
Tue, 9 Jul 2024 03:57:46 +0000 (22:57 -0500)
level_3/controller/c/thread/private-thread_process.c

index 2720596ea850fcab962e6e13b772a5bc96a344b8..e11dae05ae09c5c4f1801fd9f503a0c896272e51 100644 (file)
@@ -374,21 +374,13 @@ extern "C" {
 
           f_thread_mutex_unlock(&global->thread->lock.alert);
         }
-        else {
-          global->thread->enabled = controller_thread_enabled_not_e;
-        }
       }
       else {
         struct timespec time;
 
         do {
           status = f_thread_mutex_lock(&global->thread->lock.alert);
-
-          if (F_status_is_error(status)) {
-            global->thread->enabled = controller_thread_enabled_not_e;
-
-            break;
-          }
+          if (F_status_is_error(status)) break;
 
           controller_time(controller_thread_exit_ready_timeout_seconds_d, controller_thread_exit_ready_timeout_nanoseconds_d, &time);
 
@@ -404,9 +396,6 @@ extern "C" {
 
             f_thread_mutex_unlock(&global->thread->lock.alert);
           }
-          else {
-            global->thread->enabled = controller_thread_enabled_not_e;
-          }
         }
       }
 
@@ -426,9 +415,6 @@ extern "C" {
 
         f_thread_mutex_unlock(&global->thread->lock.alert);
       }
-      else {
-        global->thread->enabled = controller_thread_enabled_not_e;
-      }
     }
   }
 #endif // _di_controller_thread_process_exit_