12 #ifndef ASIO_DETAIL_KQUEUE_REACTOR_HPP 13 #define ASIO_DETAIL_KQUEUE_REACTOR_HPP 15 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 17 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 21 #if defined(ASIO_HAS_KQUEUE) 24 #include <sys/types.h> 25 #include <sys/event.h> 41 #if !defined(EV_OOBAND) 42 # define EV_OOBAND EV_FLAG1 43 #endif // !defined(EV_OOBAND) 54 enum op_types { read_op = 0, write_op = 1,
55 connect_op = 1, except_op = 2, max_ops = 3 };
58 struct descriptor_state
60 friend class kqueue_reactor;
61 friend class object_pool_access;
63 descriptor_state* next_;
64 descriptor_state* prev_;
69 op_queue<reactor_op> op_queue_[max_ops];
74 typedef descriptor_state* per_descriptor_data;
95 per_descriptor_data& descriptor_data);
99 ASIO_DECL int register_internal_descriptor(
101 per_descriptor_data& descriptor_data, reactor_op* op);
105 per_descriptor_data& target_descriptor_data,
106 per_descriptor_data& source_descriptor_data);
111 io_service_.post_immediate_completion(op, is_continuation);
117 per_descriptor_data& descriptor_data, reactor_op* op,
118 bool is_continuation,
bool allow_speculative);
124 per_descriptor_data& descriptor_data);
129 per_descriptor_data& descriptor_data,
bool closing);
132 ASIO_DECL void deregister_internal_descriptor(
133 socket_type descriptor, per_descriptor_data& descriptor_data);
136 template <
typename Time_Traits>
137 void add_timer_queue(timer_queue<Time_Traits>& queue);
140 template <
typename Time_Traits>
141 void remove_timer_queue(timer_queue<Time_Traits>& queue);
145 template <
typename Time_Traits>
146 void schedule_timer(timer_queue<Time_Traits>& queue,
147 const typename Time_Traits::time_type& time,
148 typename timer_queue<Time_Traits>::per_timer_data& timer, wait_op* op);
152 template <
typename Time_Traits>
153 std::size_t cancel_timer(timer_queue<Time_Traits>& queue,
154 typename timer_queue<Time_Traits>::per_timer_data& timer,
155 std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)());
158 ASIO_DECL void run(
bool block, op_queue<operation>& ops);
169 ASIO_DECL descriptor_state* allocate_descriptor_state();
172 ASIO_DECL void free_descriptor_state(descriptor_state*
s);
175 ASIO_DECL void do_add_timer_queue(timer_queue_base& queue);
178 ASIO_DECL void do_remove_timer_queue(timer_queue_base& queue);
181 ASIO_DECL timespec* get_timeout(timespec& ts);
196 timer_queue_set timer_queues_;
202 mutex registered_descriptors_mutex_;
205 object_pool<descriptor_state> registered_descriptors_;
214 #if defined(ASIO_HEADER_ONLY) 216 #endif // defined(ASIO_HEADER_ONLY) 218 #endif // defined(ASIO_HAS_KQUEUE) 220 #endif // ASIO_DETAIL_KQUEUE_REACTOR_HPP
Provides core I/O functionality.
class task_io_service io_service_impl
pipe_select_interrupter select_interrupter
fork_event
Fork-related event notifications.
bool is_continuation(Context &context)