# std::shared_lock<Mutex>::unlock

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

Unlocks the associated mutex from shared mode. Effectively calls mutex()->unlock_shared().

## Official Specification Summary (cppreference)

```cpp
void unlock(); // (since C++14)
```

Unlocks the associated mutex from shared mode. Effectively calls `mutex()->unlock_shared()`.

`std::system_error` is thrown if there is no associated mutex or if the mutex is not locked.

### Parameters

(none)

### Return value

(none)

### Exceptions

- Any exceptions thrown by `mutex()->unlock_shared()`.

- If there is no associated mutex, `std::system_error` with an error code of `std::errc::operation_not_permitted`.

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`lock`](https://en.cppreference.com/w/cpp/thread/shared_lock/lock): locks the associated mutex (public member function)
- [`release`](https://en.cppreference.com/w/cpp/thread/shared_lock/release): disassociates the mutex without unlocking (public member function)

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