File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,18 @@ namespace csp
1212{
1313
1414static volatile int g_SIGNAL_COUNT = 0 ;
15+ /*
16+ The signal count variable is maintained to ensure that multiple engine threads shutdown properly.
17+
18+ An interrupt should cause all running engines to stop, but should not affect future runs in the same process.
19+ Thus, each root engine keeps track of the signal count when its created. When an interrupt occurs, one engine thread
20+ handles the interrupt by incrementing the count. Then, all other root engines detect the signal by comparing their
21+ initial count to the current count.
22+
23+ Future runs after the interrupt remain unaffected since they are initialized with the updated signal count, and will
24+ only consider themselves "interupted" if another signal is received during their execution.
25+ */
26+
1527static struct sigaction g_prevSIGTERMaction;
1628
1729static void handle_SIGTERM ( int signum )
You can’t perform that action at this time.
0 commit comments