data.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright Oliver Kowalke 2013.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_FIBERS_DETAIL_DATA_H
  6. #define BOOST_FIBERS_DETAIL_DATA_H
  7. #include <boost/config.hpp>
  8. #include <boost/fiber/detail/config.hpp>
  9. #include <boost/fiber/detail/spinlock.hpp>
  10. #ifdef BOOST_HAS_ABI_HEADERS
  11. # include BOOST_ABI_PREFIX
  12. #endif
  13. namespace boost {
  14. namespace fibers {
  15. class context;
  16. namespace detail {
  17. struct data_t {
  18. spinlock_lock * lk{ nullptr };
  19. context * ctx{ nullptr };
  20. context * from;
  21. explicit data_t( context * from_) noexcept :
  22. from{ from_ } {
  23. }
  24. explicit data_t( spinlock_lock * lk_,
  25. context * from_) noexcept :
  26. lk{ lk_ },
  27. from{ from_ } {
  28. }
  29. explicit data_t( context * ctx_,
  30. context * from_) noexcept :
  31. ctx{ ctx_ },
  32. from{ from_ } {
  33. }
  34. };
  35. }}}
  36. #ifdef BOOST_HAS_ABI_HEADERS
  37. # include BOOST_ABI_SUFFIX
  38. #endif
  39. #endif // BOOST_FIBERS_DETAIL_DATA_H