tmp/tmphzkfihcn/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### General <a id="exec.scope.simple.counting.general">[[exec.scope.simple.counting.general]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std::execution {
|
| 5 |
+
class simple_counting_scope {
|
| 6 |
+
public:
|
| 7 |
+
// [exec.simple.counting.token], token
|
| 8 |
+
struct token;
|
| 9 |
+
|
| 10 |
+
static constexpr size_t max_associations = implementation-defined;
|
| 11 |
+
|
| 12 |
+
// [exec.simple.counting.ctor], constructor and destructor
|
| 13 |
+
simple_counting_scope() noexcept;
|
| 14 |
+
simple_counting_scope(simple_counting_scope&&) = delete;
|
| 15 |
+
~simple_counting_scope();
|
| 16 |
+
|
| 17 |
+
// [exec.simple.counting.mem], members
|
| 18 |
+
token get_token() noexcept;
|
| 19 |
+
void close() noexcept;
|
| 20 |
+
sender auto join() noexcept;
|
| 21 |
+
|
| 22 |
+
private:
|
| 23 |
+
size_t count; // exposition only
|
| 24 |
+
scope-state-type state; // exposition only
|
| 25 |
+
|
| 26 |
+
bool try-associate() noexcept; // exposition only
|
| 27 |
+
void disassociate() noexcept; // exposition only
|
| 28 |
+
template<class State>
|
| 29 |
+
bool start-join-sender(State& state) noexcept; // exposition only
|
| 30 |
+
};
|
| 31 |
+
}
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
For purposes of determining the existence of a data race, `get_token`,
|
| 35 |
+
`close`, `join`, *`try-associate`*, *`disassociate`*, and
|
| 36 |
+
*`start-join-sender`* behave as atomic operations [[intro.multithread]].
|
| 37 |
+
These operations on a single object of type `simple_counting_scope`
|
| 38 |
+
appear to occur in a single total order.
|
| 39 |
+
|