[thread.lock.shared.mod]

# 32 Concurrency support library [[thread]](./#thread)

## 32.6 Mutual exclusion [[thread.mutex]](thread.mutex#thread.lock.shared.mod)

### 32.6.5 Locks [[thread.lock]](thread.lock#shared.mod)

#### 32.6.5.5 Class template shared_lock [[thread.lock.shared]](thread.lock.shared#mod)

#### 32.6.5.5.4 Modifiers [thread.lock.shared.mod]

[ð](#lib:swap,shared_lock)

`void swap(shared_lock& sl) noexcept;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L9235)

*Effects*: Swaps the data members of *this and sl[.](#1.sentence-1)

[ð](#lib:release,shared_lock)

`mutex_type* release() noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L9246)

*Postconditions*: pm == nullptr and owns == false[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L9250)

*Returns*: The previous value of pm[.](#3.sentence-1)

[ð](#lib:swap,shared_lock_)

`template<class Mutex>
  void swap(shared_lock<Mutex>& x, shared_lock<Mutex>& y) noexcept;
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L9262)

*Effects*: As if by x.swap(y)[.](#4.sentence-1)
