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.
#if !defined(_di_kt_remove_signal_check_) && !defined(_di_thread_support_)
f_status_t kt_remove_signal_check(kt_remove_main_t * const main) {
- if (!main || main->program.signal.id == -1) return F_false;
- if (main->program.signal_received) return F_true;
+ if (!main) return F_false;
+
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+
+ main->setting.state.status = F_status_set_error(F_interrupt);
+
+ return F_true;
+ }
return F_false;
}
#if !defined(_di_kt_tacocat_signal_check_) && !defined(_di_thread_support_)
f_status_t kt_tacocat_signal_check(kt_tacocat_main_t * const main) {
- if (!main || main->program.signal.id == -1) return F_false;
- if (main->program.signal_received) return F_true;
+ if (!main) return F_false;
+
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+
+ main->setting.state.status = F_status_set_error(F_interrupt);
+
+ return F_true;
+ }
return F_false;
}