Skip to content

Commit

Permalink
transition to MaskTerminationSignalsInThread() (from libntech soon) a…
Browse files Browse the repository at this point in the history
…nd SIGHUP
  • Loading branch information
craigcomstock committed Jul 29, 2024
1 parent dd7fe67 commit 0078633
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libpromises/evalfunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
#include <version_comparison.h>
#include <mutex.h> /* ThreadWait */
#include <glob_lib.h>
#include <signal_lib.h> /* MaskTerminationSignalsInThread */

#include <math_eval.h>

Expand Down Expand Up @@ -8526,12 +8527,14 @@ static void *IsReadableThreadRoutine(void *data)
assert(data != NULL);

#ifndef HAVE_PTHREAD_CANCEL
MaskTerminationSignalsInThread();
struct sigaction actions;
memset(&actions, 0, sizeof(actions));
sigemptyset(&actions.sa_mask);
actions.sa_flags = 0;
actions.sa_handler = ThreadSignalHandler;
sigaction(SIGUSR2, &actions, NULL);
sigaction(SIGHUP, &actions, NULL);
MaskTerminationSignalsInThread();
#endif

struct IsReadableThreadData *const thread_data = data;
Expand Down

0 comments on commit 0078633

Please sign in to comment.