MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_pthread_join

Function acl_pthread_join

lib_acl/src/thread/acl_pthread.c:500–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498}
499
500int acl_pthread_join(acl_pthread_t thread, void **thread_return)
501{
502 const char *myname = "acl_pthread_join";
503 //void *return_arg;
504
505 if (thread.detached) {
506 acl_msg_error("%s(%d): thread been detached", myname, __LINE__);
507 return -1;
508 }
509 if (thread.handle == 0) {
510 acl_msg_error("%s(%d): thread->handle == 0", myname, __LINE__);
511 return -1;
512 }
513
514 WaitForSingleObject(thread.handle, INFINITE);
515
516#if 0
517 if (GetExitCodeThread(thread.handle, (LPDWORD) &return_arg)) {
518 if (thread_return != NULL)
519 *thread_return = return_arg;
520 }
521#else
522 if (thread_return != NULL) {
523 *thread_return = thread.return_arg;
524 }
525#endif
526
527 if (!CloseHandle(thread.handle)) {
528 acl_msg_error("close handle error(%s)", acl_last_serror());
529 }
530 return 0;
531}
532
533#endif /* ACL_WINDOWS */
534

Callers 15

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
taskq_destroyFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
test_tlsFunction · 0.85
netio_runFunction · 0.85
unixio_runFunction · 0.85
pipeio_runFunction · 0.85

Calls 2

acl_msg_errorFunction · 0.85
acl_last_serrorFunction · 0.85

Tested by 6

test_tlsFunction · 0.68
test_threadFunction · 0.68
test_threadFunction · 0.68
test_tlsFunction · 0.68
test_pthread_onceFunction · 0.68
test_pthread_onceFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…