What happens if i call pthread_join(NULL) ?
you get a compile time error; pthread_join() expects 2 arguments :)
If the first of the two expected arguments to pthread_join() is NULL, anything (bad) can happen at runtime. From the specification at www.opengroup.org: "The behavior is undefined if the value specified by the thread argument to pthread_join() does not refer to a joinable thread."
NULL is accepted for the second argument of pthread_join().
EDIT: Indeed some implementations can specify the behavior. Check man page for pthread_join on your system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With