##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# thread_join

From cppreference.com
< c‎ | thread

Defined in header `<threads.h>` |  |
int thrd_join( thrd_t thr, int *res ); |  | (since C11)

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

The result code of the thread is put to the location pointed to by `res`.

### [edit] Parameters

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

### [edit] Return value

thrd_success if successful, thrd_error otherwise.

### [edit] See also

thrd_detach (C11) | detaches a thread (function) [edit]
thrd_exit (C11) | terminates the calling thread (function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/thread/thrd_join&oldid=63558"