# std::mutex::~mutex

> C++ Atlas: `cppatlas.com/w/cpp/thread/mutex/~mutex` | Source: https://en.cppreference.com/w/cpp/thread/mutex/~mutex | Domain: Concurrency support

The behavior is undefined if the mutex is owned by any thread or if any thread terminates while holding any ownership of the mutex.

## Official Specification Summary (cppreference)

```cpp
~mutex();
```

Destroys the mutex.

The behavior is undefined if the mutex is owned by any thread or if any thread terminates while holding any ownership of the mutex.

### See also

- [C documentation for `mtx_destroy`](https://en.cppreference.com/w/c/thread/mtx_destroy)

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