From Jason Turner

[support.start.term]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpln5ir4mi/{from.md → to.md} +11 -13
tmp/tmpln5ir4mi/{from.md → to.md} RENAMED
@@ -53,26 +53,25 @@ succeeds, nonzero if it fails.
53
  *Effects:*
54
 
55
  - First, objects with thread storage duration and associated with the
56
  current thread are destroyed. Next, objects with static storage
57
  duration are destroyed and functions registered by calling `atexit`
58
- are called.[^30] See  [[basic.start.term]] for the order of
59
  destructions and calls. (Objects with automatic storage duration are
60
- not destroyed as a result of calling `exit()`.)[^31] If control leaves
61
- a registered function called by `exit` because the function does not
62
- provide a handler for a thrown exception, the function
63
- `std::terminate` shall be called [[except.terminate]].
64
  - Next, all open C streams (as mediated by the function signatures
65
  declared in `<cstdio>`) with unwritten buffered data are flushed, all
66
  open C streams are closed, and all files created by calling
67
  `tmpfile()` are removed.
68
  - Finally, control is returned to the host environment. If `status` is
69
  zero or `EXIT_SUCCESS`, an *implementation-defined* form of the status
70
  *successful termination* is returned. If `status` is `EXIT_FAILURE`,
71
  an *implementation-defined* form of the status *unsuccessful
72
  termination* is returned. Otherwise the status returned is
73
- *implementation-defined*. [^32]
74
 
75
  ``` cpp
76
  int at_quick_exit(c-atexit-handler* f) noexcept;
77
  int at_quick_exit(atexit-handler* f) noexcept;
78
  ```
@@ -83,15 +82,15 @@ is unspecified whether a call to `at_quick_exit()` that does not happen
83
  before [[intro.multithread]] all calls to `quick_exit` will succeed.
84
 
85
  [*Note 2*: The `at_quick_exit()` functions do not introduce a data
86
  race [[res.on.data.races]]. — *end note*]
87
 
88
- [*Note 3*: The order of registration may be indeterminate if
89
  `at_quick_exit` was called from more than one thread. — *end note*]
90
 
91
  [*Note 4*: The `at_quick_exit` registrations are distinct from the
92
- `atexit` registrations, and applications may need to call both
93
  registration functions with the same argument. — *end note*]
94
 
95
  *Implementation limits:* The implementation shall support the
96
  registration of at least 32 functions.
97
 
@@ -103,18 +102,17 @@ registration of at least 32 functions.
103
 
104
  *Effects:* Functions registered by calls to `at_quick_exit` are called
105
  in the reverse order of their registration, except that a function shall
106
  be called after any previously registered functions that had already
107
  been called at the time it was registered. Objects shall not be
108
- destroyed as a result of calling `quick_exit`. If control leaves a
109
- registered function called by `quick_exit` because the function does not
110
- provide a handler for a thrown exception, the function `std::terminate`
111
- shall be called.
112
 
113
  [*Note 5*: A function registered via `at_quick_exit` is invoked by the
114
  thread that calls `quick_exit`, which can be a different thread than the
115
- one that registered it, so registered functions should not rely on the
116
  identity of objects with thread storage duration. — *end note*]
117
 
118
  After calling registered functions, `quick_exit` shall call
119
  `_Exit(status)`.
120
 
 
53
  *Effects:*
54
 
55
  - First, objects with thread storage duration and associated with the
56
  current thread are destroyed. Next, objects with static storage
57
  duration are destroyed and functions registered by calling `atexit`
58
+ are called.[^28] See  [[basic.start.term]] for the order of
59
  destructions and calls. (Objects with automatic storage duration are
60
+ not destroyed as a result of calling `exit()`.)[^29] If a registered
61
+ function invoked by `exit` exits via an exception, the function
62
+ `std::terminate` is invoked [[except.terminate]].
 
63
  - Next, all open C streams (as mediated by the function signatures
64
  declared in `<cstdio>`) with unwritten buffered data are flushed, all
65
  open C streams are closed, and all files created by calling
66
  `tmpfile()` are removed.
67
  - Finally, control is returned to the host environment. If `status` is
68
  zero or `EXIT_SUCCESS`, an *implementation-defined* form of the status
69
  *successful termination* is returned. If `status` is `EXIT_FAILURE`,
70
  an *implementation-defined* form of the status *unsuccessful
71
  termination* is returned. Otherwise the status returned is
72
+ *implementation-defined*.[^30]
73
 
74
  ``` cpp
75
  int at_quick_exit(c-atexit-handler* f) noexcept;
76
  int at_quick_exit(atexit-handler* f) noexcept;
77
  ```
 
82
  before [[intro.multithread]] all calls to `quick_exit` will succeed.
83
 
84
  [*Note 2*: The `at_quick_exit()` functions do not introduce a data
85
  race [[res.on.data.races]]. — *end note*]
86
 
87
+ [*Note 3*: The order of registration could be indeterminate if
88
  `at_quick_exit` was called from more than one thread. — *end note*]
89
 
90
  [*Note 4*: The `at_quick_exit` registrations are distinct from the
91
+ `atexit` registrations, and applications might need to call both
92
  registration functions with the same argument. — *end note*]
93
 
94
  *Implementation limits:* The implementation shall support the
95
  registration of at least 32 functions.
96
 
 
102
 
103
  *Effects:* Functions registered by calls to `at_quick_exit` are called
104
  in the reverse order of their registration, except that a function shall
105
  be called after any previously registered functions that had already
106
  been called at the time it was registered. Objects shall not be
107
+ destroyed as a result of calling `quick_exit`. If a registered function
108
+ invoked by `quick_exit` exits via an exception, the function
109
+ `std::terminate` is invoked [[except.terminate]].
 
110
 
111
  [*Note 5*: A function registered via `at_quick_exit` is invoked by the
112
  thread that calls `quick_exit`, which can be a different thread than the
113
+ one that registered it, so registered functions cannot rely on the
114
  identity of objects with thread storage duration. — *end note*]
115
 
116
  After calling registered functions, `quick_exit` shall call
117
  `_Exit(status)`.
118