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

Method opstate

include/exec/thread_pool_base.hpp:555–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553 Receiver rcvr_;
554
555 explicit opstate(PoolType& pool, Receiver rcvr)
556 : pool_(pool)
557 , rcvr_(std::move(rcvr))
558 {
559 this->execute_ = [](_pool_::task_base* t, std::uint32_t) noexcept
560 {
561 auto& op = *static_cast<opstate*>(t);
562 auto stoken = STDEXEC::get_stop_token(STDEXEC::get_env(op.rcvr_));
563
564 if constexpr (STDEXEC::unstoppable_token<decltype(stoken)>)
565 { // NOLINT(bugprone-branch-clone)
566 STDEXEC::set_value(static_cast<Receiver&&>(op.rcvr_));
567 }
568 else if (stoken.stop_requested())
569 {
570 STDEXEC::set_stopped(static_cast<Receiver&&>(op.rcvr_));
571 }
572 else
573 {
574 STDEXEC::set_value(static_cast<Receiver&&>(op.rcvr_));
575 }
576 };
577 }
578
579 void enqueue() noexcept
580 {

Callers

nothing calls this directly

Calls 4

set_valueFunction · 0.85
get_envFunction · 0.70
set_stoppedFunction · 0.70
stop_requestedMethod · 0.45

Tested by

no test coverage detected