# std::shared_lock<Mutex>::~shared_lock

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

If *this has an associated mutex ((mutex() returns a non-null pointer) and has acquired ownership of it (owns() returns true), the mutex is unlocked by calling unlock_shared().

## Official Specification Summary (cppreference)

```cpp
~shared_lock(); // (since C++14)
```

Destroys the lock.

If `*this` has an associated mutex ((`mutex()` returns a non-null pointer) and has acquired ownership of it (`owns()` returns `true`), the mutex is unlocked by calling `unlock_shared()`.

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