thrd_join

thrd_join

Defined in header
int thrd_join( thrd_t thr, int *res (since C11)

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

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

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.

Parameters

thr-identifier of the thread to join
res-location to put the result code to

Return value

thrd_success if successful, thrd_error otherwise.

References

  • C11 standard (ISO/IEC 9899:2011):

See also

thrd_detach (C11)detaches a thread (function)
thrd_exit (C11)terminates the calling thread (function)

| C++ documentation for join |

© cppreference.com

Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.

http://en.cppreference.com/w/c/thread/thrd_join