[saferecl.rcu.domain.members]

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

## 32.11 Safe reclamation [[saferecl]](saferecl#rcu.domain.members)

### 32.11.2 Read-copy update (RCU) [[saferecl.rcu]](saferecl.rcu#domain.members)

#### 32.11.2.4 Class rcu_domain [[saferecl.rcu.domain]](saferecl.rcu.domain#members)

#### 32.11.2.4.2 Member functions [saferecl.rcu.domain.members]

[ð](#lib:lock,rcu_domain)

`void lock() noexcept;
`

[1](#1)

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

*Effects*: Opens a region of RCU protection[.](#1.sentence-1)

[2](#2)

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

*Remarks*: Calls to lock do not introduce a data race ([[intro.races]](intro.races "6.10.2.2 Data races")) involving *this[.](#2.sentence-1)

[ð](#lib:try_lock,rcu_domain)

`bool try_lock() noexcept;
`

[3](#3)

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

*Effects*: Equivalent to lock()[.](#3.sentence-1)

[4](#4)

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

*Returns*: true[.](#4.sentence-1)

[ð](#lib:unlock,rcu_domain)

`void unlock() noexcept;
`

[5](#5)

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

*Preconditions*: A call to lock that opened an unclosed region of RCU protection
is sequenced before the call to unlock[.](#5.sentence-1)

[6](#6)

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

*Effects*: Closes the unclosed region of RCU protection
that was most recently opened[.](#6.sentence-1)

May invoke scheduled evaluations in *this[.](#6.sentence-2)

[7](#7)

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

[*Note [1](#note-1)*:

If such evaluations acquire resources
held across any invocation of unlock on *this,
deadlock can occur[.](#7.sentence-1)

â *end note*]

[8](#8)

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

*Remarks*: Calls to unlock do not introduce a data race involving *this[.](#8.sentence-1)

[*Note [2](#note-2)*:

Evaluation of scheduled evaluations can still cause a data race[.](#8.sentence-2)

â *end note*]
