hpx/coroutines/stackless_coroutine.hpp

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace threads
namespace coroutines
class stackless_coroutine

Public Types

using thread_id_type = hpx::threads::thread_id
using result_type = std::pair<thread_schedule_state, thread_id_type>
using arg_type = thread_restart_state
using functor_type = hpx::move_only_function<result_type(arg_type)>

Public Functions

stackless_coroutine(functor_type &&f, thread_id_type id, std::ptrdiff_t = default_stack_size)
~stackless_coroutine()
stackless_coroutine(stackless_coroutine const &src)
stackless_coroutine &operator=(stackless_coroutine const &src)
stackless_coroutine(stackless_coroutine &&src)
stackless_coroutine &operator=(stackless_coroutine &&src)
thread_id_type get_thread_id() const
std::size_t get_thread_data() const
std::size_t set_thread_data(std::size_t data)
void rebind(functor_type &&f, thread_id_type id)
void reset_tss()
void reset()
stackless_coroutine::result_type operator()(arg_type arg = arg_type())
operator bool() const
bool is_ready() const
std::ptrdiff_t get_available_stack_space()
std::size_t &get_continuation_recursion_count()

Protected Attributes

functor_type f_
context_state state_
thread_id_type id_
std::size_t thread_data_
std::size_t continuation_recursion_count_

Private Types

enum context_state

Values:

ctx_running
ctx_ready
ctx_exited

Private Functions

bool running() const
bool exited() const

Private Static Attributes

constexpr std::ptrdiff_t default_stack_size = -1

Friends

friend hpx::threads::coroutines::reset_on_exit
struct reset_on_exit

Public Functions

reset_on_exit(stackless_coroutine &this__)
~reset_on_exit()

Public Members

stackless_coroutine &this_