c/thread/thrd join

Blocks the current thread until the thread identified by finishes execution.

If is not a null pointer, the result code of the thread is put to the location pointed to by.

The termination of the thread synchronizes-with the completion of this function.

The behavior is undefined if the thread was previously detached or joined by another thread.

Return value
thrd_success if successful, thrd_error otherwise.