# mtx_destroy

> C++ Atlas: `cppatlas.com/w/c/thread/mtx_destroy` | Source: https://en.cppreference.com/w/c/thread/mtx_destroy | Domain: Concurrency support | Standards: C11

Destroys the mutex pointed to by mutex.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <threads.h>
void mtx_destroy( mtx_t *mutex ); // (since C11)
```

Destroys the mutex pointed to by `mutex`.

If there are threads waiting on `mutex`, the behavior is undefined.

### Parameters

- `mutex` - pointer to the mutex to destroy

### Return value

(none)

### References

- C17 standard (ISO/IEC 9899:2018):

  - 7.26.4.1 The mtx_destroy function (p: 277)

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

  - 7.26.4.1 The mtx_destroy function (p: 380)

### See also

- [C++ documentation for `~mutex`](https://en.cppreference.com/w/cpp/thread/mutex/~mutex)
- [C++ documentation for `~timed_mutex`](https://en.cppreference.com/w/cpp/thread/timed_mutex/~timed_mutex)
- [C++ documentation for `~recursive_mutex`](https://en.cppreference.com/w/cpp/thread/recursive_mutex/~recursive_mutex)
- [C++ documentation for `~recursive_timed_mutex`](https://en.cppreference.com/w/cpp/thread/recursive_timed_mutex/~recursive_timed_mutex)

---
Attribution: content from https://en.cppreference.com/w/c/thread/mtx_destroy (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.