[thread.lock.unique.mod]

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

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

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

#### 32.6.5.4 Class template unique_lock [[thread.lock.unique]](thread.lock.unique#mod)

#### 32.6.5.4.4 Modifiers [thread.lock.unique.mod]

[ð](#lib:swap,unique_lock)

`void swap(unique_lock& u) noexcept;
`

[1](#1)

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

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

[ð](#lib:release,unique_lock)

`mutex_type* release() noexcept;
`

[2](#2)

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

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

[3](#3)

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

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

[ð](#lib:swap,unique_lock_)

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

[4](#4)

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

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