tmp/tmp2rkodkvm/{from.md → to.md}
RENAMED
|
@@ -12,36 +12,36 @@ namespace std {
|
|
| 12 |
|
| 13 |
void lock();
|
| 14 |
bool try_lock() noexcept;
|
| 15 |
void unlock();
|
| 16 |
|
| 17 |
-
using native_handle_type = implementation-defined;
|
| 18 |
-
native_handle_type native_handle();
|
| 19 |
};
|
| 20 |
}
|
| 21 |
```
|
| 22 |
|
| 23 |
The class `recursive_mutex` provides a recursive mutex with exclusive
|
| 24 |
ownership semantics. If one thread owns a `recursive_mutex` object,
|
| 25 |
attempts by another thread to acquire ownership of that object will fail
|
| 26 |
(for `try_lock()`) or block (for `lock()`) until the first thread has
|
| 27 |
completely released ownership.
|
| 28 |
|
| 29 |
-
The class `recursive_mutex`
|
| 30 |
-
|
| 31 |
-
|
| 32 |
|
| 33 |
A thread that owns a `recursive_mutex` object may acquire additional
|
| 34 |
levels of ownership by calling `lock()` or `try_lock()` on that object.
|
| 35 |
It is unspecified how many levels of ownership may be acquired by a
|
| 36 |
single thread. If a thread has already acquired the maximum level of
|
| 37 |
ownership for a `recursive_mutex` object, additional calls to
|
| 38 |
-
`try_lock()`
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
| 44 |
The behavior of a program is undefined if:
|
| 45 |
|
| 46 |
- it destroys a `recursive_mutex` object owned by any thread or
|
| 47 |
- a thread terminates while owning a `recursive_mutex` object.
|
|
|
|
| 12 |
|
| 13 |
void lock();
|
| 14 |
bool try_lock() noexcept;
|
| 15 |
void unlock();
|
| 16 |
|
| 17 |
+
using native_handle_type = implementation-defined; // see~[thread.req.native]
|
| 18 |
+
native_handle_type native_handle(); // see~[thread.req.native]
|
| 19 |
};
|
| 20 |
}
|
| 21 |
```
|
| 22 |
|
| 23 |
The class `recursive_mutex` provides a recursive mutex with exclusive
|
| 24 |
ownership semantics. If one thread owns a `recursive_mutex` object,
|
| 25 |
attempts by another thread to acquire ownership of that object will fail
|
| 26 |
(for `try_lock()`) or block (for `lock()`) until the first thread has
|
| 27 |
completely released ownership.
|
| 28 |
|
| 29 |
+
The class `recursive_mutex` meets all of the mutex requirements
|
| 30 |
+
[[thread.mutex.requirements]]. It is a standard-layout class
|
| 31 |
+
[[class.prop]].
|
| 32 |
|
| 33 |
A thread that owns a `recursive_mutex` object may acquire additional
|
| 34 |
levels of ownership by calling `lock()` or `try_lock()` on that object.
|
| 35 |
It is unspecified how many levels of ownership may be acquired by a
|
| 36 |
single thread. If a thread has already acquired the maximum level of
|
| 37 |
ownership for a `recursive_mutex` object, additional calls to
|
| 38 |
+
`try_lock()` fail, and additional calls to `lock()` throw an exception
|
| 39 |
+
of type `system_error`. A thread shall call `unlock()` once for each
|
| 40 |
+
level of ownership acquired by calls to `lock()` and `try_lock()`. Only
|
| 41 |
+
when all levels of ownership have been released may ownership be
|
| 42 |
+
acquired by another thread.
|
| 43 |
|
| 44 |
The behavior of a program is undefined if:
|
| 45 |
|
| 46 |
- it destroys a `recursive_mutex` object owned by any thread or
|
| 47 |
- a thread terminates while owning a `recursive_mutex` object.
|