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

Function thread_start

src/threadwrappers.cpp:70–91  ·  view source on GitHub ↗

Invoked via pthread_create as start_routine On return, it calls mtcp_threadiszombie()

Source from the content-addressed store, hash-verified

68// Invoked via pthread_create as start_routine
69// On return, it calls mtcp_threadiszombie()
70static void *
71thread_start(void *arg)
72{
73 Thread *thread = (Thread *) arg;
74
75 processChildThread(thread);
76
77 void *result = thread->fn(thread->arg);
78
79 JTRACE("Thread returned") (thread->tid);
80 WrapperLock wrapperLock;
81 ThreadList::threadExit();
82
83 /*
84 * This thread has finished its execution, do some cleanup on our part.
85 * erasing the virtualTid entry from virtualpidtable
86 * FIXME: What if the process gets checkpointed after erase() but before the
87 * thread actually exits?
88 */
89 PluginManager::eventHook(DMTCP_EVENT_PTHREAD_RETURN, NULL);
90 return result;
91}
92
93extern "C" int
94pthread_create(pthread_t *pth,

Callers

nothing calls this directly

Calls 2

processChildThreadFunction · 0.85
eventHookFunction · 0.85

Tested by

no test coverage detected