##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# thread_exit

From cppreference.com
< c‎ | thread

Defined in header `<threads.h>` |  |
_Noreturn void thrd_exit( int res ); |  | (since C11)

Terminates the current thread and sets its result code to `res`.

| This section is incomplete Reason: The termination of the program after the last thread. The standard seems to be contradictory

### [edit] Parameters

res | - | the result value to return

### [edit] Return value

(none)

### [edit] See also

thrd_join (C11) | blocks until a thread terminates (function) [edit]
thrd_detach (C11) | detaches a thread (function) [edit]

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

- Todo with reason