2
// Copyright Oliver Kowalke 2009.
3
// Distributed under the Boost Software License, Version 1.0.
4
// (See accompanying file LICENSE_1_0.txt or copy at
5
// http://www.boost.org/LICENSE_1_0.txt)
7
#ifndef BOOST_COROUTINES_DETAIL_COROUTINE_CONTEXT_H
8
#define BOOST_COROUTINES_DETAIL_COROUTINE_CONTEXT_H
12
#include <boost/assert.hpp>
13
#include <boost/config.hpp>
14
#include <boost/context/fcontext.hpp>
16
#include <boost/coroutine/detail/config.hpp>
17
#include "boost/coroutine/stack_context.hpp"
19
#ifdef BOOST_HAS_ABI_HEADERS
20
# include BOOST_ABI_PREFIX
23
#if defined(BOOST_USE_SEGMENTED_STACKS)
24
extern "C" void *__splitstack_makecontext(
25
std::size_t, void * [BOOST_COROUTINES_SEGMENTS], std::size_t *);
29
namespace coroutines {
33
class BOOST_COROUTINES_DECL coroutine_context : private context::fcontext_t,
38
stack_context * stack_ctx_;
39
context::fcontext_t * ctx_;
42
typedef void( * ctx_fn)( intptr_t);
46
explicit coroutine_context( ctx_fn, stack_context *);
48
coroutine_context( coroutine_context const&);
50
coroutine_context& operator=( coroutine_context const&);
52
intptr_t jump( coroutine_context &, intptr_t = 0, bool = true);
57
#ifdef BOOST_HAS_ABI_HEADERS
58
# include BOOST_ABI_SUFFIX
61
#endif // BOOST_COROUTINES_DETAIL_COROUTINE_CONTEXT_H