]> Kevux Git Server - control/commitdiff
Update: The threaded signal handler to avoid signal id races. development
authorKevin Day <Kevin@kevux.org>
Fri, 24 Jan 2025 03:00:00 +0000 (21:00 -0600)
committerKevin Day <Kevin@kevux.org>
Fri, 24 Jan 2025 03:00:00 +0000 (21:00 -0600)
Apply the same anti-race improvements implemented on the non-threaded signal checker to the threaded signal checker.

Still check for a negative id to prevent the signal message from being printed more than once.

sources/c/program/control/main/signal.c

index c99735a07b50a51c659ea66973d8eaecd30c9cd8..6a577a7749aa9fe22aced2f123879d7e7eeff08c 100644 (file)
@@ -29,7 +29,7 @@ extern "C" {
 #if !defined(_di_control_signal_check_) && !defined(_di_thread_support_)
   f_status_t control_signal_check(control_main_t * const main) {
 
-    if (!main || main->program.signal.id == -1) return F_false;
+    if (!main) return F_false;
 
     if (main->program.signal_received) {
       fll_program_print_signal_received(&main->program.warning, main->program.signal_received);