tmp/tmpz9q91qdc/{from.md → to.md}
RENAMED
|
@@ -25,26 +25,26 @@ namespace std {
|
|
| 25 |
jthread& operator=(const jthread&) = delete;
|
| 26 |
jthread& operator=(jthread&&) noexcept;
|
| 27 |
|
| 28 |
// [thread.jthread.mem], members
|
| 29 |
void swap(jthread&) noexcept;
|
| 30 |
-
|
| 31 |
void join();
|
| 32 |
void detach();
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
| 36 |
// [thread.jthread.stop], stop token handling
|
| 37 |
-
|
| 38 |
-
|
| 39 |
bool request_stop() noexcept;
|
| 40 |
|
| 41 |
// [thread.jthread.special], specialized algorithms
|
| 42 |
friend void swap(jthread& lhs, jthread& rhs) noexcept;
|
| 43 |
|
| 44 |
// [thread.jthread.static], static members
|
| 45 |
-
|
| 46 |
|
| 47 |
private:
|
| 48 |
stop_source ssource; // exposition only
|
| 49 |
};
|
| 50 |
}
|
|
@@ -156,11 +156,11 @@ void swap(jthread& x) noexcept;
|
|
| 156 |
```
|
| 157 |
|
| 158 |
*Effects:* Exchanges the values of `*this` and `x`.
|
| 159 |
|
| 160 |
``` cpp
|
| 161 |
-
|
| 162 |
```
|
| 163 |
|
| 164 |
*Returns:* `get_id() != id()`.
|
| 165 |
|
| 166 |
``` cpp
|
|
@@ -217,17 +217,17 @@ represent a thread, otherwise `this_thread::get_id()` for the thread of
|
|
| 217 |
execution represented by `*this`.
|
| 218 |
|
| 219 |
#### Stop token handling <a id="thread.jthread.stop">[[thread.jthread.stop]]</a>
|
| 220 |
|
| 221 |
``` cpp
|
| 222 |
-
|
| 223 |
```
|
| 224 |
|
| 225 |
*Effects:* Equivalent to: `return ssource;`
|
| 226 |
|
| 227 |
``` cpp
|
| 228 |
-
|
| 229 |
```
|
| 230 |
|
| 231 |
*Effects:* Equivalent to: `return ssource.get_token();`
|
| 232 |
|
| 233 |
``` cpp
|
|
@@ -245,10 +245,10 @@ friend void swap(jthread& x, jthread& y) noexcept;
|
|
| 245 |
*Effects:* Equivalent to: `x.swap(y)`.
|
| 246 |
|
| 247 |
#### Static members <a id="thread.jthread.static">[[thread.jthread.static]]</a>
|
| 248 |
|
| 249 |
``` cpp
|
| 250 |
-
|
| 251 |
```
|
| 252 |
|
| 253 |
*Returns:* `thread::hardware_concurrency()`.
|
| 254 |
|
|
|
|
| 25 |
jthread& operator=(const jthread&) = delete;
|
| 26 |
jthread& operator=(jthread&&) noexcept;
|
| 27 |
|
| 28 |
// [thread.jthread.mem], members
|
| 29 |
void swap(jthread&) noexcept;
|
| 30 |
+
bool joinable() const noexcept;
|
| 31 |
void join();
|
| 32 |
void detach();
|
| 33 |
+
id get_id() const noexcept;
|
| 34 |
+
native_handle_type native_handle(); // see~[thread.req.native]
|
| 35 |
|
| 36 |
// [thread.jthread.stop], stop token handling
|
| 37 |
+
stop_source get_stop_source() noexcept;
|
| 38 |
+
stop_token get_stop_token() const noexcept;
|
| 39 |
bool request_stop() noexcept;
|
| 40 |
|
| 41 |
// [thread.jthread.special], specialized algorithms
|
| 42 |
friend void swap(jthread& lhs, jthread& rhs) noexcept;
|
| 43 |
|
| 44 |
// [thread.jthread.static], static members
|
| 45 |
+
static unsigned int hardware_concurrency() noexcept;
|
| 46 |
|
| 47 |
private:
|
| 48 |
stop_source ssource; // exposition only
|
| 49 |
};
|
| 50 |
}
|
|
|
|
| 156 |
```
|
| 157 |
|
| 158 |
*Effects:* Exchanges the values of `*this` and `x`.
|
| 159 |
|
| 160 |
``` cpp
|
| 161 |
+
bool joinable() const noexcept;
|
| 162 |
```
|
| 163 |
|
| 164 |
*Returns:* `get_id() != id()`.
|
| 165 |
|
| 166 |
``` cpp
|
|
|
|
| 217 |
execution represented by `*this`.
|
| 218 |
|
| 219 |
#### Stop token handling <a id="thread.jthread.stop">[[thread.jthread.stop]]</a>
|
| 220 |
|
| 221 |
``` cpp
|
| 222 |
+
stop_source get_stop_source() noexcept;
|
| 223 |
```
|
| 224 |
|
| 225 |
*Effects:* Equivalent to: `return ssource;`
|
| 226 |
|
| 227 |
``` cpp
|
| 228 |
+
stop_token get_stop_token() const noexcept;
|
| 229 |
```
|
| 230 |
|
| 231 |
*Effects:* Equivalent to: `return ssource.get_token();`
|
| 232 |
|
| 233 |
``` cpp
|
|
|
|
| 245 |
*Effects:* Equivalent to: `x.swap(y)`.
|
| 246 |
|
| 247 |
#### Static members <a id="thread.jthread.static">[[thread.jthread.static]]</a>
|
| 248 |
|
| 249 |
``` cpp
|
| 250 |
+
static unsigned int hardware_concurrency() noexcept;
|
| 251 |
```
|
| 252 |
|
| 253 |
*Returns:* `thread::hardware_concurrency()`.
|
| 254 |
|