# zx_thread_exit

## Summary

Terminate the current running thread.

## Declaration

    #include <zircon/syscalls.h>

    [[noreturn]] void zx_thread_exit(void);

## Description

`zx_thread_exit()` causes the currently running thread to cease
running and exit.

The signal `ZX_THREAD_TERMINATED` will be asserted on the thread
object upon exit and may be observed via [`zx_object_wait_one()`](https://fuchsia.dev/reference/syscalls/object_wait_one)
or [`zx_object_wait_many()`](https://fuchsia.dev/reference/syscalls/object_wait_many) on a handle to the thread.

## Rights

TODO(https://fxbug.dev/42107318)

## Return value

`zx_thread_exit()` does not return.

## See also

- [`zx_handle_close()`](https://fuchsia.dev/reference/syscalls/handle_close)
- [`zx_handle_duplicate()`](https://fuchsia.dev/reference/syscalls/handle_duplicate)
- [`zx_object_wait_async()`](https://fuchsia.dev/reference/syscalls/object_wait_async)
- [`zx_object_wait_many()`](https://fuchsia.dev/reference/syscalls/object_wait_many)
- [`zx_object_wait_one()`](https://fuchsia.dev/reference/syscalls/object_wait_one)
- [`zx_thread_create()`](https://fuchsia.dev/reference/syscalls/thread_create)
- [`zx_thread_start()`](https://fuchsia.dev/reference/syscalls/thread_start)