Init
This commit is contained in:
32
cppdraft/stopsource/cons.md
Normal file
32
cppdraft/stopsource/cons.md
Normal file
@@ -0,0 +1,32 @@
|
||||
[stopsource.cons]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopsource.cons)
|
||||
|
||||
### 32.3.5 Class stop_source [[stopsource]](stopsource#cons)
|
||||
|
||||
#### 32.3.5.2 Constructors, copy, and assignment [stopsource.cons]
|
||||
|
||||
[ð](#lib:stop_source,constructor)
|
||||
|
||||
`stop_source();
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L954)
|
||||
|
||||
*Effects*: Initializes *stop-state* with a pointer to a new stop state[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L958)
|
||||
|
||||
*Postconditions*: stop_possible() is true and stop_requested() is false[.](#2.sentence-1)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L963)
|
||||
|
||||
*Throws*: bad_alloc if memory cannot be allocated for the stop state[.](#3.sentence-1)
|
||||
27
cppdraft/stopsource/general.md
Normal file
27
cppdraft/stopsource/general.md
Normal file
@@ -0,0 +1,27 @@
|
||||
[stopsource.general]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopsource.general)
|
||||
|
||||
### 32.3.5 Class stop_source [[stopsource]](stopsource#general)
|
||||
|
||||
#### 32.3.5.1 General [stopsource.general]
|
||||
|
||||
namespace std {class stop_source {public:// [[stopsource.cons]](stopsource.cons "32.3.5.2 Constructors, copy, and assignment"), constructors, copy, and assignment stop_source(); explicit stop_source(nostopstate_t) noexcept {}// [[stopsource.mem]](stopsource.mem "32.3.5.3 Member functions"), member functionsvoid swap(stop_source&) noexcept;
|
||||
|
||||
stop_token get_token() const noexcept; bool stop_possible() const noexcept; bool stop_requested() const noexcept; bool request_stop() noexcept; bool operator==(const stop_source& rhs) noexcept = default; private: shared_ptr<*unspecified*> *stop-state*; // *exposition only*};}
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L935)
|
||||
|
||||
*stop-state* refers to the stop_source's associated stop state[.](#1.sentence-1)
|
||||
|
||||
A stop_source object is disengaged when *stop-state* is empty[.](#1.sentence-2)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L939)
|
||||
|
||||
stop_source models[*stoppable-source*](stoptoken.concepts#concept:stoppable-source "32.3.3 Stop token concepts [stoptoken.concepts]"),[copyable](concepts.object#concept:copyable "18.6 Object concepts [concepts.object]"),[equality_comparable](concept.equalitycomparable#concept:equality_comparable "18.5.4 Concept equality_comparable [concept.equalitycomparable]"), and[swappable](concept.swappable#concept:swappable "18.4.9 Concept swappable [concept.swappable]")[.](#2.sentence-1)
|
||||
83
cppdraft/stopsource/inplace.md
Normal file
83
cppdraft/stopsource/inplace.md
Normal file
@@ -0,0 +1,83 @@
|
||||
[stopsource.inplace]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopsource.inplace)
|
||||
|
||||
### 32.3.9 Class inplace_stop_source [stopsource.inplace]
|
||||
|
||||
#### [32.3.9.1](#general) General [[stopsource.inplace.general]](stopsource.inplace.general)
|
||||
|
||||
[1](#general-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1241)
|
||||
|
||||
The class inplace_stop_source models [*stoppable-source*](stoptoken.concepts#concept:stoppable-source "32.3.3 Stop token concepts [stoptoken.concepts]")[.](#general-1.sentence-1)
|
||||
|
||||
namespace std {class inplace_stop_source {public:// [[stopsource.inplace.cons]](#cons "32.3.9.2 Constructors"), constructorsconstexpr inplace_stop_source() noexcept;
|
||||
|
||||
inplace_stop_source(inplace_stop_source&&) = delete;
|
||||
inplace_stop_source(const inplace_stop_source&) = delete;
|
||||
inplace_stop_source& operator=(inplace_stop_source&&) = delete;
|
||||
inplace_stop_source& operator=(const inplace_stop_source&) = delete; ~inplace_stop_source(); // [[stopsource.inplace.mem]](#mem "32.3.9.3 Member functions"), stop handlingconstexpr inplace_stop_token get_token() const noexcept; static constexpr bool stop_possible() noexcept { return true; }bool stop_requested() const noexcept; bool request_stop() noexcept; };}
|
||||
|
||||
#### [32.3.9.2](#cons) Constructors [[stopsource.inplace.cons]](stopsource.inplace.cons)
|
||||
|
||||
[ð](#cons-itemdecl:1)
|
||||
|
||||
`constexpr inplace_stop_source() noexcept;
|
||||
`
|
||||
|
||||
[1](#cons-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1273)
|
||||
|
||||
*Effects*: Initializes a new stop state inside *this[.](#cons-1.sentence-1)
|
||||
|
||||
[2](#cons-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1277)
|
||||
|
||||
*Postconditions*: stop_requested() is false[.](#cons-2.sentence-1)
|
||||
|
||||
#### [32.3.9.3](#mem) Member functions [[stopsource.inplace.mem]](stopsource.inplace.mem)
|
||||
|
||||
[ð](#mem-itemdecl:1)
|
||||
|
||||
`constexpr inplace_stop_token get_token() const noexcept;
|
||||
`
|
||||
|
||||
[1](#mem-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1289)
|
||||
|
||||
*Returns*: A new associated inplace_stop_token object
|
||||
whose *stop-source* member is equal to this[.](#mem-1.sentence-1)
|
||||
|
||||
[ð](#mem-itemdecl:2)
|
||||
|
||||
`bool stop_requested() const noexcept;
|
||||
`
|
||||
|
||||
[2](#mem-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1300)
|
||||
|
||||
*Returns*: true if the stop state inside *this has received a stop request; otherwise, false[.](#mem-2.sentence-1)
|
||||
|
||||
[ð](#mem-itemdecl:3)
|
||||
|
||||
`bool request_stop() noexcept;
|
||||
`
|
||||
|
||||
[3](#mem-3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1311)
|
||||
|
||||
*Effects*: Executes a stop request operation ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts"))[.](#mem-3.sentence-1)
|
||||
|
||||
[4](#mem-4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1315)
|
||||
|
||||
*Postconditions*: stop_requested() is true[.](#mem-4.sentence-1)
|
||||
26
cppdraft/stopsource/inplace/cons.md
Normal file
26
cppdraft/stopsource/inplace/cons.md
Normal file
@@ -0,0 +1,26 @@
|
||||
[stopsource.inplace.cons]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopsource.inplace.cons)
|
||||
|
||||
### 32.3.9 Class inplace_stop_source [[stopsource.inplace]](stopsource.inplace#cons)
|
||||
|
||||
#### 32.3.9.2 Constructors [stopsource.inplace.cons]
|
||||
|
||||
[ð](#itemdecl:1)
|
||||
|
||||
`constexpr inplace_stop_source() noexcept;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1273)
|
||||
|
||||
*Effects*: Initializes a new stop state inside *this[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1277)
|
||||
|
||||
*Postconditions*: stop_requested() is false[.](#2.sentence-1)
|
||||
22
cppdraft/stopsource/inplace/general.md
Normal file
22
cppdraft/stopsource/inplace/general.md
Normal file
@@ -0,0 +1,22 @@
|
||||
[stopsource.inplace.general]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopsource.inplace.general)
|
||||
|
||||
### 32.3.9 Class inplace_stop_source [[stopsource.inplace]](stopsource.inplace#general)
|
||||
|
||||
#### 32.3.9.1 General [stopsource.inplace.general]
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1241)
|
||||
|
||||
The class inplace_stop_source models [*stoppable-source*](stoptoken.concepts#concept:stoppable-source "32.3.3 Stop token concepts [stoptoken.concepts]")[.](#1.sentence-1)
|
||||
|
||||
namespace std {class inplace_stop_source {public:// [[stopsource.inplace.cons]](stopsource.inplace.cons "32.3.9.2 Constructors"), constructorsconstexpr inplace_stop_source() noexcept;
|
||||
|
||||
inplace_stop_source(inplace_stop_source&&) = delete;
|
||||
inplace_stop_source(const inplace_stop_source&) = delete;
|
||||
inplace_stop_source& operator=(inplace_stop_source&&) = delete;
|
||||
inplace_stop_source& operator=(const inplace_stop_source&) = delete; ~inplace_stop_source(); // [[stopsource.inplace.mem]](stopsource.inplace.mem "32.3.9.3 Member functions"), stop handlingconstexpr inplace_stop_token get_token() const noexcept; static constexpr bool stop_possible() noexcept { return true; }bool stop_requested() const noexcept; bool request_stop() noexcept; };}
|
||||
49
cppdraft/stopsource/inplace/mem.md
Normal file
49
cppdraft/stopsource/inplace/mem.md
Normal file
@@ -0,0 +1,49 @@
|
||||
[stopsource.inplace.mem]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopsource.inplace.mem)
|
||||
|
||||
### 32.3.9 Class inplace_stop_source [[stopsource.inplace]](stopsource.inplace#mem)
|
||||
|
||||
#### 32.3.9.3 Member functions [stopsource.inplace.mem]
|
||||
|
||||
[ð](#itemdecl:1)
|
||||
|
||||
`constexpr inplace_stop_token get_token() const noexcept;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1289)
|
||||
|
||||
*Returns*: A new associated inplace_stop_token object
|
||||
whose *stop-source* member is equal to this[.](#1.sentence-1)
|
||||
|
||||
[ð](#itemdecl:2)
|
||||
|
||||
`bool stop_requested() const noexcept;
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1300)
|
||||
|
||||
*Returns*: true if the stop state inside *this has received a stop request; otherwise, false[.](#2.sentence-1)
|
||||
|
||||
[ð](#itemdecl:3)
|
||||
|
||||
`bool request_stop() noexcept;
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1311)
|
||||
|
||||
*Effects*: Executes a stop request operation ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts"))[.](#3.sentence-1)
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1315)
|
||||
|
||||
*Postconditions*: stop_requested() is true[.](#4.sentence-1)
|
||||
70
cppdraft/stopsource/mem.md
Normal file
70
cppdraft/stopsource/mem.md
Normal file
@@ -0,0 +1,70 @@
|
||||
[stopsource.mem]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopsource.mem)
|
||||
|
||||
### 32.3.5 Class stop_source [[stopsource]](stopsource#mem)
|
||||
|
||||
#### 32.3.5.3 Member functions [stopsource.mem]
|
||||
|
||||
[ð](#lib:swap,stop_source)
|
||||
|
||||
`void swap(stop_source& rhs) noexcept;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L976)
|
||||
|
||||
*Effects*: Equivalent to:*stop-state*.swap(rhs.*stop-state*);
|
||||
|
||||
[ð](#lib:get_token,stop_source)
|
||||
|
||||
`stop_token get_token() const noexcept;
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L990)
|
||||
|
||||
*Returns*: stop_token() if stop_possible() is false;
|
||||
otherwise a new associated stop_token object;
|
||||
i.e., its *stop-state* member is equal to
|
||||
the *stop-state* member of *this[.](#2.sentence-1)
|
||||
|
||||
[ð](#lib:stop_possible,stop_source)
|
||||
|
||||
`bool stop_possible() const noexcept;
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1004)
|
||||
|
||||
*Returns*: *stop-state* != nullptr[.](#3.sentence-1)
|
||||
|
||||
[ð](#lib:stop_requested,stop_source)
|
||||
|
||||
`bool stop_requested() const noexcept;
|
||||
`
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1015)
|
||||
|
||||
*Returns*: true if *stop-state* refers to a stop state
|
||||
that has received a stop request;
|
||||
otherwise, false[.](#4.sentence-1)
|
||||
|
||||
[ð](#lib:request_stop,stop_source)
|
||||
|
||||
`bool request_stop() noexcept;
|
||||
`
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1028)
|
||||
|
||||
*Effects*: Executes a stop request operation ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts")) on
|
||||
the associated stop state, if any[.](#5.sentence-1)
|
||||
Reference in New Issue
Block a user