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

Function pthread_join

src/threadwrappers.cpp:215–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213 */
214static struct timespec ts_100ms = { 0, 100 * 1000 * 1000 };
215extern "C" int
216pthread_join(pthread_t thread, void **retval)
217{
218 int ret;
219 struct timespec ts;
220
221 if (!ProcessInfo::instance().beginPthreadJoin(thread)) {
222 return EINVAL;
223 }
224
225 while (1) {
226 WrapperLock wrapperLock;
227 JASSERT(clock_gettime(CLOCK_REALTIME, &ts) != -1);
228 TIMESPEC_ADD(&ts, &ts_100ms, &ts);
229 ret = _real_pthread_timedjoin_np(thread, retval, &ts);
230 if (ret != ETIMEDOUT) {
231 break;
232 }
233 }
234
235 ProcessInfo::instance().endPthreadJoin(thread);
236 return ret;
237}
238
239extern "C" int
240pthread_tryjoin_np(pthread_t thread, void **retval)

Callers 7

mainFunction · 0.85
mainFunction · 0.85
child_threadFunction · 0.85
mainFunction · 0.85
cancel_and_join_threadFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 4

clock_gettimeFunction · 0.85
beginPthreadJoinMethod · 0.80
endPthreadJoinMethod · 0.80

Tested by

no test coverage detected