* * Restore signal mask and all pending signals * *****************************************************************************/
| 889 | * |
| 890 | *****************************************************************************/ |
| 891 | void |
| 892 | Thread_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 | * |
no test coverage detected