0

If you have a thread A which calls pthread_exit(return_val) before thread B can call pthread_join(A, ret_val_A), what is the outcome? Does join return as if the thread did not exist?

Clarification: Im not asking if you can join once a thread has exited, more so will the return value be valid if it has already exited and you call join after.

beans
  • 31
  • 5
  • 3
    1. Why don't you read the [manual](https://www.man7.org/linux/man-pages/man3/pthread_join.3.html)? 2. Why don't you write some code and try it? – kaylum Mar 05 '22 at 05:27
  • i did, it does not specify. obviously some systems are different than others so I was wondering if it was generally considered unsafe. – beans Mar 06 '22 at 17:47

0 Answers0