| 1 | |
|---|---|
| 2 | // Copyright Oliver Kowalke 2013. |
| 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_FIBERS_DETAIL_DATA_H |
| 8 | #define BOOST_FIBERS_DETAIL_DATA_H |
| 9 | |
| 10 | #include <boost/config.hpp> |
| 11 | |
| 12 | #include <boost/fiber/detail/config.hpp> |
| 13 | #include <boost/fiber/detail/spinlock.hpp> |
| 14 | |
| 15 | #ifdef BOOST_HAS_ABI_HEADERS |
| 16 | # include BOOST_ABI_PREFIX |
| 17 | #endif |
| 18 | |
| 19 | namespace boost { |
| 20 | namespace fibers { |
| 21 | |
| 22 | class context; |
| 23 | |
| 24 | namespace detail { |
| 25 | |
| 26 | struct data_t { |
| 27 | spinlock_lock * lk{ nullptr }; |
| 28 | context * ctx{ nullptr }; |
| 29 | context * from; |
| 30 | |
| 31 | explicit data_t( context * from_) noexcept : |
| 32 | from{ from_ } { |
| 33 | } |
| 34 | |
| 35 | explicit data_t( spinlock_lock * lk_, |
| 36 | context * from_) noexcept : |
| 37 | lk{ lk_ }, |
| 38 | from{ from_ } { |
| 39 | } |
| 40 | |
| 41 | explicit data_t( context * ctx_, |
| 42 | context * from_) noexcept : |
| 43 | ctx{ ctx_ }, |
| 44 | from{ from_ } { |
| 45 | } |
| 46 | }; |
| 47 | |
| 48 | }}} |
| 49 | |
| 50 | #ifdef BOOST_HAS_ABI_HEADERS |
| 51 | # include BOOST_ABI_SUFFIX |
| 52 | #endif |
| 53 | |
| 54 | #endif // BOOST_FIBERS_DETAIL_DATA_H |
| 55 |
