MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / request_stop

Method request_stop

include/stdexec/stop_token.hpp:253–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251 }
252
253 inline auto inplace_stop_source::request_stop() noexcept -> bool
254 {
255 if (!__try_lock_unless_stop_requested_(true))
256 return true;
257
258 __notifying_thread_ = std::this_thread::get_id();
259
260 // We are responsible for executing callbacks.
261 while (__callbacks_ != nullptr)
262 {
263 auto* __callbk = __callbacks_;
264 __callbk->__prev_ptr_ = nullptr;
265 __callbacks_ = __callbk->__next_;
266 if (__callbacks_ != nullptr)
267 __callbacks_->__prev_ptr_ = &__callbacks_;
268
269 __state_.store(__stop_requested_flag_, STDEXEC::__std::memory_order_release);
270
271 bool __removed_during_callback = false;
272 __callbk->__removed_during_callback_ = &__removed_during_callback;
273
274 __callbk->__execute();
275
276 if (!__removed_during_callback)
277 {
278 __callbk->__removed_during_callback_ = nullptr;
279 __callbk->__callback_completed_.store(true, STDEXEC::__std::memory_order_release);
280 }
281
282 __lock_();
283 }
284
285 __state_.store(__stop_requested_flag_, STDEXEC::__std::memory_order_release);
286 return false;
287 }
288
289 inline auto inplace_stop_source::__lock_() const noexcept -> uint8_t
290 {

Calls 3

get_idFunction · 0.85
storeMethod · 0.45
__executeMethod · 0.45

Tested by

no test coverage detected