Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
boost::fibers::asio::detail::yield_handler_base Class Reference

#include <yield.hpp>

Inheritance diagram for boost::fibers::asio::detail::yield_handler_base:
Collaboration diagram for boost::fibers::asio::detail::yield_handler_base:

Public Member Functions

 yield_handler_base (yield_t const &y)
 
void operator() (boost::system::error_code const &ec)
 

Public Attributes

boost::fibers::context * ctx_
 
yield_t yt_
 
yield_completionycomp_ { nullptr }
 

Detailed Description

Definition at line 63 of file yield.hpp.

Constructor & Destructor Documentation

◆ yield_handler_base()

boost::fibers::asio::detail::yield_handler_base::yield_handler_base ( yield_t const & y)
inline

Definition at line 65 of file yield.hpp.

65 :
66 // capture the context* associated with the running fiber
67 ctx_{ boost::fibers::context::active() },
68 // capture the passed yield_t
69 yt_( y ) {
70 }

Member Function Documentation

◆ operator()()

void boost::fibers::asio::detail::yield_handler_base::operator() ( boost::system::error_code const & ec)
inline

Definition at line 73 of file yield.hpp.

73 {
74 BOOST_ASSERT_MSG( ycomp_,
75 "Must inject yield_completion* "
76 "before calling yield_handler_base::operator()()");
77 BOOST_ASSERT_MSG( yt_.ec_,
78 "Must inject boost::system::error_code* "
79 "before calling yield_handler_base::operator()()");
80 // If originating fiber is busy testing completed_ flag, wait until it
81 // has observed (! completed_).
83 // Notify a subsequent yield_completion::wait() call that it need not
84 // suspend.
85 ycomp_->completed_ = true;
86 // set the error_code bound by yield_t
87 * yt_.ec_ = ec;
88 // If ctx_ is still active, e.g. because the async operation
89 // immediately called its callback (this method!) before the asio
90 // async function called async_result_base::get(), we must not set it
91 // ready.
92 if ( fibers::context::active() != ctx_ ) {
93 // wake the fiber
94 fibers::context::active()->set_ready( ctx_);
95 }
96 }
boost::system::error_code * ec_
Definition yield.hpp:46
std::unique_lock< mutex_t > lock_t
Definition yield.hpp:34
Here is the caller graph for this function:

Member Data Documentation

◆ ctx_

boost::fibers::context* boost::fibers::asio::detail::yield_handler_base::ctx_

Definition at line 99 of file yield.hpp.

◆ ycomp_

yield_completion* boost::fibers::asio::detail::yield_handler_base::ycomp_ { nullptr }

Definition at line 103 of file yield.hpp.

103{ nullptr };

◆ yt_

yield_t boost::fibers::asio::detail::yield_handler_base::yt_

Definition at line 100 of file yield.hpp.


The documentation for this class was generated from the following file: