• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_TYPE_H
8 #define BOOST_FIBERS_TYPE_H
9 
10 #include <atomic>
11 #include <chrono>
12 #include <exception>
13 #include <functional>
14 #include <map>
15 #include <memory>
16 #include <type_traits>
17 
18 #include <boost/assert.hpp>
19 #include <boost/config.hpp>
20 #include <boost/context/detail/apply.hpp>
21 #include <boost/context/stack_context.hpp>
22 #include <boost/intrusive/list.hpp>
23 #include <boost/intrusive/parent_from_member.hpp>
24 #include <boost/intrusive_ptr.hpp>
25 #include <boost/intrusive/set.hpp>
26 
27 #include <boost/fiber/detail/config.hpp>
28 #include <boost/fiber/detail/data.hpp>
29 #include <boost/fiber/detail/decay_copy.hpp>
30 #include <boost/fiber/detail/fss.hpp>
31 #include <boost/fiber/detail/spinlock.hpp>
32 #include <boost/fiber/exceptions.hpp>
33 #include <boost/fiber/fixedsize_stack.hpp>
34 #include <boost/fiber/properties.hpp>
35 #include <boost/fiber/segmented_stack.hpp>
36 
37 #ifdef BOOST_HAS_ABI_HEADERS
38 #  include BOOST_ABI_PREFIX
39 #endif
40 
41 namespace boost {
42 namespace fibers {
43 
44 enum class type {
45     none               = 0,
46     main_context       = 1 << 1,
47     dispatcher_context = 1 << 2,
48     worker_context     = 1 << 3,
49     pinned_context     = main_context | dispatcher_context
50 };
51 
52 inline
53 constexpr type
operator &(type l,type r)54 operator&( type l, type r) {
55     return static_cast< type >(
56             static_cast< unsigned int >( l) & static_cast< unsigned int >( r) );
57 }
58 
59 inline
60 constexpr type
operator |(type l,type r)61 operator|( type l, type r) {
62     return static_cast< type >(
63             static_cast< unsigned int >( l) | static_cast< unsigned int >( r) );
64 }
65 
66 inline
67 constexpr type
operator ^(type l,type r)68 operator^( type l, type r) {
69     return static_cast< type >(
70             static_cast< unsigned int >( l) ^ static_cast< unsigned int >( r) );
71 }
72 
73 inline
74 constexpr type
operator ~(type l)75 operator~( type l) {
76     return static_cast< type >( ~static_cast< unsigned int >( l) );
77 }
78 
79 inline
80 type &
operator &=(type & l,type r)81 operator&=( type & l, type r) {
82     l = l & r;
83     return l;
84 }
85 
86 inline
87 type &
operator |=(type & l,type r)88 operator|=( type & l, type r) {
89     l = l | r;
90     return l;
91 }
92 
93 inline
94 type &
operator ^=(type & l,type r)95 operator^=( type & l, type r) {
96     l = l ^ r;
97     return l;
98 }
99 
100 }}
101 
102 #ifdef BOOST_HAS_ABI_HEADERS
103 #  include BOOST_ABI_SUFFIX
104 #endif
105 
106 #endif // BOOST_FIBERS_TYPE_H
107