f_pthread_join(thread, ret)

Purpose

This function can be called to join a particular thread designated by the argument thread. If the target thread is in non-detached state and is already terminated, this call will return immediately with the target thread's status returned in argument ret if it is provided. The argument ret is optional. Currently, ret must be an Integer pointer if it is provided.

If the target thread is in detached state, it is an error to join it.

Class

Function

Argument Type and Attributes

thread
TYPE(f_pthread_t), INTENT(IN)

ret
Integer pointer, INTENT(OUT), OPTIONAL

Result Type and Attributes

INTEGER(4)

Result Value

On successful completion, this function returns 0. Otherwise, this function returns one of the following errors.

EDEADLK
This call will cause a deadlock, or the calling thread is trying to join itself.

EINVAL
The argument thread is invalid.

ESRCH
The argument thread designates a thread which does not exist or is in detached state.
IBM Copyright 2003