# zx::thread

## Summary

### Inheritance

Inherits from: [zx::task\< thread \>](https://fuchsia.dev/reference/cpp/class/zx/task)

| ### Constructors and Destructors ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1a86b151f5798249ed3a338e4bad82f009()` ||
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1a983ee4043bad4807af6dfc5aaad6b81d(zx_handle_t value)` ||
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1a4ed545872839d71d20a3fb098632efda(https://fuchsia.dev/reference/cpp/class/zx/object#classzx_1_1object && h)` ||
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1a5e0dd8bafeb353e71f55d03da9b793f8(https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread && other)` ||

| ### Public static attributes ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1a511f083d123e2ee16a29e070d311f708 = ZX_OBJ_TYPE_THREAD` | `constexpr zx_obj_type_t` |

| ### Public functions ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1a1c182ca6a677380c082b4e940c603be5(https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread && other)` | `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread &` |
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1a0ef41eb779a82135d67ba38412d933b5(uint32_t kind, void *buffer, size_t len)` | `zx_status_t` |
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1ae01eaa33670a36a1c85efcaa97d7b3d8(uintptr_t thread_entry, uintptr_t stack, uintptr_t arg1, uintptr_t arg2)` | `zx_status_t` |
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1a0983d46aab83f5feae6a145a39e61e7b(void(*)(uintptr_t arg1, uintptr_t arg2) thread_entry, void *stack, uintptr_t arg1, uintptr_t arg2)` | `zx_status_t` |
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1afeee1be6402fd929a6d94dda7acb6e31(uint32_t kind, const void *buffer, size_t len)` | `zx_status_t` |

| ### Public static functions ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1a0cf300f8ecf27718c27a894f450ed7e8(const https://fuchsia.dev/reference/cpp/class/zx/process#classzx_1_1process & process, const char *name, uint32_t name_len, uint32_t flags, https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread *result)` | `zx_status_t` |
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1aa304f4123feb21e893c6e44961fcb82e(uint32_t options, zx_excp_type_t type, const https://fuchsia.dev/reference/cpp/struct/zx-exception-context#structzx__exception__context *context)` | `zx_status_t` |
| `https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread_1aaeaf5826e4d2fd568e191213e095f7ea()` | `https://fuchsia.dev/reference/cpp/other/singletonzx/unowned#singletonzx_1_1unowned< https://fuchsia.dev/reference/cpp/class/zx/thread#classzx_1_1thread >` |

## Public static attributes

### TYPE

```c++
constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_THREAD
```

## Public functions

### operator=

```c++
thread & operator=(
  thread && other
)
```

### read_state

```c++
zx_status_t read_state(
  uint32_t kind,
  void *buffer,
  size_t len
)
```

### start

```c++
zx_status_t start(
  uintptr_t thread_entry,
  uintptr_t stack,
  uintptr_t arg1,
  uintptr_t arg2
)
```

### start

```c++
zx_status_t start(
  void(*)(uintptr_t arg1, uintptr_t arg2) thread_entry,
  void *stack,
  uintptr_t arg1,
  uintptr_t arg2
)
```

### thread

```c++
constexpr thread()=default
```

### thread

```c++
 thread(
  zx_handle_t value
)
```

### thread

```c++
 thread(
  handle && h
)
```

### thread

```c++
 thread(
  thread && other
)
```

### write_state

```c++
zx_status_t write_state(
  uint32_t kind,
  const void *buffer,
  size_t len
)
```

## Public static functions

### create

```c++
zx_status_t create(
  const process & process,
  const char *name,
  uint32_t name_len,
  uint32_t flags,
  thread *result
)
```

### raise_exception

```c++
zx_status_t raise_exception(
  uint32_t options,
  zx_excp_type_t type,
  const zx_exception_context_t *context
)
```

### self

```c++
unowned< thread > self()
```