| 45 | } |
| 46 | |
| 47 | static void |
| 48 | processChildThread(Thread *thread) |
| 49 | { |
| 50 | dmtcp_init_virtual_tid(); |
| 51 | JASSERT(thread->wrapperLockCount != 0); |
| 52 | |
| 53 | ThreadList::initThread(thread); |
| 54 | // Unblock ckpt signal (unblocking a non-blocked signal has no effect). |
| 55 | // Normally, DMTCP wouldn't allow the ckpt signal to be blocked. However, in |
| 56 | // some situations (e.g., timer_create), libc would internally block all |
| 57 | // signals before calling pthread_create to create a helper thread. Since, |
| 58 | // the child threads inherit parent signal mask, the helper thread has all |
| 59 | // signals blocked. |
| 60 | sigset_t set; |
| 61 | sigaddset(&set, SigInfo::ckptSignal()); |
| 62 | JASSERT(_real_pthread_sigmask(SIG_UNBLOCK, &set, NULL) == 0) (JASSERT_ERRNO); |
| 63 | |
| 64 | // Lock was acquired by the parent thread on our behalf. |
| 65 | ThreadSync::wrapperExecutionLockUnlock(); |
| 66 | } |
| 67 | |
| 68 | // Invoked via pthread_create as start_routine |
| 69 | // On return, it calls mtcp_threadiszombie() |
no test coverage detected