tmp/tmp3gq4rvut/{from.md → to.md}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
##### Class shared_mutex <a id="thread.sharedmutex.class">[[thread.sharedmutex.class]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
class shared_mutex {
|
| 6 |
public:
|
|
@@ -8,32 +8,32 @@ namespace std {
|
|
| 8 |
~shared_mutex();
|
| 9 |
|
| 10 |
shared_mutex(const shared_mutex&) = delete;
|
| 11 |
shared_mutex& operator=(const shared_mutex&) = delete;
|
| 12 |
|
| 13 |
-
//
|
| 14 |
void lock(); // blocking
|
| 15 |
bool try_lock();
|
| 16 |
void unlock();
|
| 17 |
|
| 18 |
-
//
|
| 19 |
void lock_shared(); // blocking
|
| 20 |
bool try_lock_shared();
|
| 21 |
void unlock_shared();
|
| 22 |
|
| 23 |
-
using native_handle_type = implementation-defined;
|
| 24 |
-
native_handle_type native_handle();
|
| 25 |
};
|
| 26 |
}
|
| 27 |
```
|
| 28 |
|
| 29 |
The class `shared_mutex` provides a non-recursive mutex with shared
|
| 30 |
ownership semantics.
|
| 31 |
|
| 32 |
-
The class `shared_mutex`
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
| 36 |
The behavior of a program is undefined if:
|
| 37 |
|
| 38 |
- it destroys a `shared_mutex` object owned by any thread,
|
| 39 |
- a thread attempts to recursively gain any ownership of a
|
|
|
|
| 1 |
+
##### Class `shared_mutex` <a id="thread.sharedmutex.class">[[thread.sharedmutex.class]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
class shared_mutex {
|
| 6 |
public:
|
|
|
|
| 8 |
~shared_mutex();
|
| 9 |
|
| 10 |
shared_mutex(const shared_mutex&) = delete;
|
| 11 |
shared_mutex& operator=(const shared_mutex&) = delete;
|
| 12 |
|
| 13 |
+
// exclusive ownership
|
| 14 |
void lock(); // blocking
|
| 15 |
bool try_lock();
|
| 16 |
void unlock();
|
| 17 |
|
| 18 |
+
// shared ownership
|
| 19 |
void lock_shared(); // blocking
|
| 20 |
bool try_lock_shared();
|
| 21 |
void unlock_shared();
|
| 22 |
|
| 23 |
+
using native_handle_type = implementation-defined; // see~[thread.req.native]
|
| 24 |
+
native_handle_type native_handle(); // see~[thread.req.native]
|
| 25 |
};
|
| 26 |
}
|
| 27 |
```
|
| 28 |
|
| 29 |
The class `shared_mutex` provides a non-recursive mutex with shared
|
| 30 |
ownership semantics.
|
| 31 |
|
| 32 |
+
The class `shared_mutex` meets all of the shared mutex requirements
|
| 33 |
+
[[thread.sharedmutex.requirements]]. It is a standard-layout class
|
| 34 |
+
[[class.prop]].
|
| 35 |
|
| 36 |
The behavior of a program is undefined if:
|
| 37 |
|
| 38 |
- it destroys a `shared_mutex` object owned by any thread,
|
| 39 |
- a thread attempts to recursively gain any ownership of a
|