---
name: "std::shared_mutex"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::shared_mutex"
---

# std::shared\_mutex(3cxx)

The standard shared mutex type.

## NAME

std::shared\_mutex - The standard shared mutex type.

## SYNOPSIS

`#include <shared_mutex>`

### Public Member Functions

**shared\_mutex** (const **shared\_mutex** &)=**delete**\
 **void** **lock** ()\
 **void** **lock\_shared** ()\
 **shared\_mutex** & **operator=** (const **shared\_mutex** &)=**delete**\
 bool **try\_lock** ()\
 bool **try\_lock\_shared** ()\
 **void** **unlock** ()\
 **void** **unlock\_shared** ()\

### Related Symbols

(Note that these are not member symbols.)  template\<**typename** **\_Mutex** \> **void** **swap** (**shared\_lock**\< **\_Mutex** \> &\_\_x, **shared\_lock**\< **\_Mutex** \> &\_\_y) noexcept\
 Swap specialization for shared\_lock.

## Detailed Description

The standard shared mutex type.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
