MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / Thread_RestoreSigState

Function Thread_RestoreSigState

src/threadlist.cpp:891–914  ·  view source on GitHub ↗

* * Restore signal mask and all pending signals * *****************************************************************************/

Source from the content-addressed store, hash-verified

889 *
890 *****************************************************************************/
891void
892Thread_RestoreSigState(Thread *th)
893{
894 int i;
895
896 JTRACE("restoring signal mask for thread") (th->tid);
897 JASSERT(pthread_sigmask(SIG_SETMASK, &th->sigblockmask, NULL) == 0);
898
899 // Raise the signals which were pending for only this thread at the time of
900 // checkpoint.
901 for (i = SIGRTMAX; i > 0; --i) {
902 if (sigismember(&th->sigpending, i) == 1 &&
903 sigismember(&th->sigblockmask, i) == 1 &&
904 sigismember(&sigpending_global, i) == 0 &&
905 i != dmtcp_get_ckpt_signal()) {
906 if (i != SIGCHLD) {
907 JNOTE("\n*** WARNING: SIGCHLD was delivered prior to ckpt.\n"
908 "*** Will raise it on restart. If not desired, change\n"
909 "*** this line raising SIGCHLD.");
910 }
911 raise(i);
912 }
913 }
914}
915
916/*****************************************************************************
917 *

Callers 1

waitForAllRestoredMethod · 0.85

Calls 2

pthread_sigmaskFunction · 0.85
dmtcp_get_ckpt_signalFunction · 0.70

Tested by

no test coverage detected