![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/include/boost/coroutine/detail/ |
Upload File : |
// Copyright Oliver Kowalke 2009. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_COROUTINES_DETAIL_COROUTINE_CONTEXT_H #define BOOST_COROUTINES_DETAIL_COROUTINE_CONTEXT_H #include <cstddef> #include <boost/assert.hpp> #include <boost/config.hpp> #include <boost/context/detail/fcontext.hpp> #include <boost/coroutine/detail/config.hpp> #include <boost/coroutine/detail/preallocated.hpp> #include <boost/coroutine/stack_context.hpp> #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif namespace boost { namespace coroutines { namespace detail { // class hold stack-context and coroutines execution-context class BOOST_COROUTINES_DECL coroutine_context { private: template< typename Coro > friend void trampoline( context::detail::transfer_t); template< typename Coro > friend void trampoline_void( context::detail::transfer_t); template< typename Coro > friend void trampoline_pull( context::detail::transfer_t); template< typename Coro > friend void trampoline_push( context::detail::transfer_t); template< typename Coro > friend void trampoline_push_void( context::detail::transfer_t); preallocated palloc_; context::detail::fcontext_t ctx_; public: typedef void( * ctx_fn)( context::detail::transfer_t); // default ctor represents the current execution-context coroutine_context(); // ctor creates a new execution-context running coroutine-fn `fn` // `ctx_` will be allocated on top of the stack managed by parameter // `stack_ctx` coroutine_context( ctx_fn fn, preallocated const& palloc); coroutine_context( coroutine_context const&); coroutine_context& operator=( coroutine_context const&); void * jump( coroutine_context &, void * = 0); stack_context & stack_ctx() { return palloc_.sctx; } }; }}} #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif #endif // BOOST_COROUTINES_DETAIL_COROUTINE_CONTEXT_H