@@ -147,30 +147,30 @@ int main() {
147147 assert (jthread::hardware_concurrency () == thread::hardware_concurrency ());
148148
149149 { // first wait_until overload; without the cancellation this would deadlock
150- jthread worker ([](stop_token token) {
151- mutex m ;
152- condition_variable_any cv;
150+ mutex m;
151+ condition_variable_any cv ;
152+ jthread worker ([&](stop_token token) {
153153 unique_lock lck{m};
154154 assert (cv.wait (lck, move (token), [] { return false ; }) == false );
155155 });
156156 }
157157
158- static constexpr auto forever = chrono::steady_clock::duration::max ();
159- static constexpr auto infinity = chrono::steady_clock::time_point::max ();
158+ constexpr auto forever = chrono::steady_clock::duration::max ();
159+ constexpr auto infinity = chrono::steady_clock::time_point::max ();
160160
161161 { // ditto without the cancellation this would deadlock
162- jthread worker ([](stop_token token) {
163- mutex m ;
164- condition_variable_any cv;
162+ mutex m;
163+ condition_variable_any cv ;
164+ jthread worker ([&](stop_token token) {
165165 unique_lock lck{m};
166166 assert (cv.wait_until (lck, move (token), infinity, [] { return false ; }) == false );
167167 });
168168 }
169169
170170 { // ditto without the cancellation this would deadlock
171- jthread worker ([](stop_token token) {
172- mutex m ;
173- condition_variable_any cv;
171+ mutex m;
172+ condition_variable_any cv ;
173+ jthread worker ([&](stop_token token) {
174174 unique_lock lck{m};
175175 assert (cv.wait_for (lck, move (token), forever, [] { return false ; }) == false );
176176 });
0 commit comments