This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
[stoptoken.inplace.general]
# 32 Concurrency support library [[thread]](./#thread)
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stoptoken.inplace.general)
### 32.3.8 Class inplace_stop_token [[stoptoken.inplace]](stoptoken.inplace#general)
#### 32.3.8.1 General [stoptoken.inplace.general]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1158)
The class inplace_stop_token models
the concept [stoppable_token](stoptoken.concepts#concept:stoppable_token "32.3.3Stop token concepts[stoptoken.concepts]")[.](#1.sentence-1)
It references the stop state of
its associated inplace_stop_source object ([[stopsource.inplace]](stopsource.inplace "32.3.9Class inplace_­stop_­source")),
if any[.](#1.sentence-2)
namespace std {class inplace_stop_token {public:template<class CallbackFn>using callback_type = inplace_stop_callback<CallbackFn>;
inplace_stop_token() = default; bool operator==(const inplace_stop_token&) const = default; // [[stoptoken.inplace.mem]](stoptoken.inplace.mem "32.3.8.2Member functions"), member functionsbool stop_requested() const noexcept; bool stop_possible() const noexcept; void swap(inplace_stop_token&) noexcept; private:const inplace_stop_source* *stop-source* = nullptr; // *exposition only*};}

View File

@@ -0,0 +1,69 @@
[stoptoken.inplace.mem]
# 32 Concurrency support library [[thread]](./#thread)
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stoptoken.inplace.mem)
### 32.3.8 Class inplace_stop_token [[stoptoken.inplace]](stoptoken.inplace#mem)
#### 32.3.8.2 Member functions [stoptoken.inplace.mem]
[🔗](#itemdecl:1)
`void swap(inplace_stop_token& rhs) noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1192)
*Effects*: Exchanges the values of *stop-source* and rhs.*stop-source*[.](#1.sentence-1)
[🔗](#itemdecl:2)
`bool stop_requested() const noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1202)
*Effects*: Equivalent to:return *stop-source* != nullptr && *stop-source*->stop_requested();
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1209)
[*Note [1](#note-1)*:
As specified in [[basic.life]](basic.life "6.8.4Lifetime"),
the behavior of stop_requested is undefined
unless the call strongly happens before the start of
the destructor of the associated inplace_stop_source object, if any[.](#3.sentence-1)
— *end note*]
[🔗](#itemdecl:3)
`stop_possible() const noexcept;
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1223)
*Returns*: *stop-source* != nullptr[.](#4.sentence-1)
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1227)
[*Note [2](#note-2)*:
As specified in [[basic.stc.general]](basic.stc.general "6.8.6.1General"),
the behavior of stop_possible is implementation-defined
unless the call strongly happens before
the end of the storage duration of
the associated inplace_stop_source object, if any[.](#5.sentence-1)
— *end note*]