tmp/tmpwm6tn8ck/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### General <a id="saferecl.rcu.domain.general">[[saferecl.rcu.domain.general]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
class rcu_domain {
|
| 6 |
+
public:
|
| 7 |
+
rcu_domain(const rcu_domain&) = delete;
|
| 8 |
+
rcu_domain& operator=(const rcu_domain&) = delete;
|
| 9 |
+
|
| 10 |
+
void lock() noexcept;
|
| 11 |
+
bool try_lock() noexcept;
|
| 12 |
+
void unlock() noexcept;
|
| 13 |
+
};
|
| 14 |
+
}
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
This class meets the requirements of *Cpp17Lockable*
|
| 18 |
+
[[thread.req.lockable.req]] and provides regions of RCU protection.
|
| 19 |
+
|
| 20 |
+
[*Example 1*:
|
| 21 |
+
|
| 22 |
+
``` cpp
|
| 23 |
+
std::scoped_lock<rcu_domain> rlock(rcu_default_domain());
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
— *end example*]
|
| 27 |
+
|
| 28 |
+
The functions `lock` and `unlock` establish (possibly nested) regions of
|
| 29 |
+
RCU protection.
|
| 30 |
+
|