]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/coroutine2/include/boost/coroutine2/detail/push_control_block_ecv1.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / coroutine2 / include / boost / coroutine2 / detail / push_control_block_ecv1.hpp
1
2 // Copyright Oliver Kowalke 2014.
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)
6
7 #ifndef BOOST_COROUTINES2_DETAIL_PUSH_CONTROL_BLOCK_HPP
8 #define BOOST_COROUTINES2_DETAIL_PUSH_CONTROL_BLOCK_HPP
9
10 #include <functional>
11 #include <exception>
12
13 #include <boost/config.hpp>
14 #include <boost/context/execution_context.hpp>
15
16 #include <boost/coroutine2/detail/state.hpp>
17
18 #ifdef BOOST_HAS_ABI_HEADERS
19 # include BOOST_ABI_PREFIX
20 #endif
21
22 namespace boost {
23 namespace coroutines2 {
24 namespace detail {
25
26 template< typename T >
27 struct push_coroutine< T >::control_block {
28 boost::context::execution_context ctx;
29 typename pull_coroutine< T >::control_block * other;
30 state_t state;
31 std::exception_ptr except;
32
33 static void destroy( control_block * cb) noexcept;
34
35 template< typename StackAllocator, typename Fn >
36 control_block( context::preallocated, StackAllocator, Fn &&);
37
38 control_block( typename pull_coroutine< T >::control_block *, boost::context::execution_context const&) noexcept;
39
40 ~control_block() noexcept;
41
42 control_block( control_block &) = delete;
43 control_block & operator=( control_block &) = delete;
44
45 void deallocate() noexcept;
46
47 void resume( T const&);
48
49 void resume( T &&);
50
51 bool valid() const noexcept;
52 };
53
54 template< typename T >
55 struct push_coroutine< T & >::control_block {
56 boost::context::execution_context ctx;
57 typename pull_coroutine< T & >::control_block * other;
58 state_t state;
59 std::exception_ptr except;
60
61 static void destroy( control_block * cb) noexcept;
62
63 template< typename StackAllocator, typename Fn >
64 control_block( context::preallocated, StackAllocator, Fn &&);
65
66 control_block( typename pull_coroutine< T & >::control_block *, boost::context::execution_context const&) noexcept;
67
68 ~control_block() noexcept;
69
70 control_block( control_block &) = delete;
71 control_block & operator=( control_block &) = delete;
72
73 void deallocate() noexcept;
74
75 void resume( T &);
76
77 bool valid() const noexcept;
78 };
79
80 struct push_coroutine< void >::control_block {
81 boost::context::execution_context ctx;
82 pull_coroutine< void >::control_block * other;
83 state_t state;
84 std::exception_ptr except;
85
86 static void destroy( control_block * cb) noexcept;
87
88 template< typename StackAllocator, typename Fn >
89 control_block( context::preallocated, StackAllocator, Fn &&);
90
91 control_block( pull_coroutine< void >::control_block *, boost::context::execution_context const&) noexcept;
92
93 ~control_block() noexcept;
94
95 control_block( control_block &) = delete;
96 control_block & operator=( control_block &) = delete;
97
98 void deallocate() noexcept;
99
100 void resume();
101
102 bool valid() const noexcept;
103 };
104
105 }}}
106
107 #ifdef BOOST_HAS_ABI_HEADERS
108 # include BOOST_ABI_SUFFIX
109 #endif
110
111 #endif // BOOST_COROUTINES2_DETAIL_PUSH_CONTROL_BLOCK_HPP