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

Function processChildThread

src/threadwrappers.cpp:47–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47static void
48processChildThread(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()

Callers 1

thread_startFunction · 0.85

Calls 2

dmtcp_init_virtual_tidFunction · 0.85
_real_pthread_sigmaskFunction · 0.85

Tested by

no test coverage detected