Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
boost::fibers::asio::detail::yield_completion Struct Reference

#include <yield.hpp>

Public Types

typedef fibers::detail::spinlock mutex_t
 
typedef std::unique_lock< mutex_tlock_t
 

Public Member Functions

void wait ()
 

Public Attributes

mutex_t mtx_ {}
 
bool completed_ { false }
 

Detailed Description

Definition at line 32 of file yield.hpp.

Member Typedef Documentation

◆ lock_t

Definition at line 34 of file yield.hpp.

◆ mutex_t

Definition at line 33 of file yield.hpp.

Member Function Documentation

◆ wait()

void boost::fibers::asio::detail::yield_completion::wait ( )
inline

Definition at line 39 of file yield.hpp.

39 {
40 // yield_handler_base::operator()() will set completed_ true and
41 // attempt to wake a suspended fiber. It would be Bad if that call
42 // happened between our detecting (! completed_) and suspending.
43 lock_t lk{ mtx_ };
44 // If completed_ is already set, we're done here: don't suspend.
45 if ( ! completed_) {
46 // suspend(unique_lock<spinlock>) unlocks the lock in the act of
47 // resuming another fiber
48 fibers::context::active()->suspend( lk);
49 }
50 }
std::unique_lock< mutex_t > lock_t
Definition yield.hpp:34
Here is the caller graph for this function:

Member Data Documentation

◆ completed_

bool boost::fibers::asio::detail::yield_completion::completed_ { false }

Definition at line 37 of file yield.hpp.

37{ false };

◆ mtx_

mutex_t boost::fibers::asio::detail::yield_completion::mtx_ {}

Definition at line 36 of file yield.hpp.

36{};

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