diff options
author | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
commit | 08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch) | |
tree | 7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/asio/detail/impl/select_reactor.ipp | |
parent | bb4dd8289b351fae6b55e303f189127a394a1edd (diff) | |
download | boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2 boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip |
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/asio/detail/impl/select_reactor.ipp')
-rw-r--r-- | boost/asio/detail/impl/select_reactor.ipp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/boost/asio/detail/impl/select_reactor.ipp b/boost/asio/detail/impl/select_reactor.ipp index d11904e40d..c8e04a26d4 100644 --- a/boost/asio/detail/impl/select_reactor.ipp +++ b/boost/asio/detail/impl/select_reactor.ipp @@ -2,7 +2,7 @@ // detail/impl/select_reactor.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -20,7 +20,8 @@ #if defined(BOOST_ASIO_HAS_IOCP) \ || (!defined(BOOST_ASIO_HAS_DEV_POLL) \ && !defined(BOOST_ASIO_HAS_EPOLL) \ - && !defined(BOOST_ASIO_HAS_KQUEUE)) + && !defined(BOOST_ASIO_HAS_KQUEUE) \ + && !defined(BOOST_ASIO_WINDOWS_RUNTIME)) #include <boost/asio/detail/bind_handler.hpp> #include <boost/asio/detail/fd_set_adapter.hpp> @@ -122,13 +123,14 @@ void select_reactor::move_descriptor(socket_type, } void select_reactor::start_op(int op_type, socket_type descriptor, - select_reactor::per_descriptor_data&, reactor_op* op, bool) + select_reactor::per_descriptor_data&, reactor_op* op, + bool is_continuation, bool) { boost::asio::detail::mutex::scoped_lock lock(mutex_); if (shutdown_) { - post_immediate_completion(op); + post_immediate_completion(op, is_continuation); return; } @@ -180,21 +182,21 @@ void select_reactor::run(bool block, op_queue<operation>& ops) for (int i = 0; i < max_select_ops; ++i) { have_work_to_do = have_work_to_do || !op_queue_[i].empty(); - op_queue_[i].get_descriptors(fd_sets_[i], ops); + fd_sets_[i].set(op_queue_[i], ops); if (fd_sets_[i].max_descriptor() > max_fd) max_fd = fd_sets_[i].max_descriptor(); } -#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) // Connection operations on Windows use both except and write fd_sets. have_work_to_do = have_work_to_do || !op_queue_[connect_op].empty(); - op_queue_[connect_op].get_descriptors(fd_sets_[write_op], ops); + fd_sets_[write_op].set(op_queue_[connect_op], ops); if (fd_sets_[write_op].max_descriptor() > max_fd) max_fd = fd_sets_[write_op].max_descriptor(); - op_queue_[connect_op].get_descriptors(fd_sets_[except_op], ops); + fd_sets_[except_op].set(op_queue_[connect_op], ops); if (fd_sets_[except_op].max_descriptor() > max_fd) max_fd = fd_sets_[except_op].max_descriptor(); -#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) // We can return immediately if there's no work to do and the reactor is // not supposed to block. @@ -224,18 +226,16 @@ void select_reactor::run(bool block, op_queue<operation>& ops) // Dispatch all ready operations. if (retval > 0) { -#if defined(BOOST_WINDOWS) || defined(__CYGWIN__) +#if defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) // Connection operations on Windows use both except and write fd_sets. - op_queue_[connect_op].perform_operations_for_descriptors( - fd_sets_[except_op], ops); - op_queue_[connect_op].perform_operations_for_descriptors( - fd_sets_[write_op], ops); -#endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__) + fd_sets_[except_op].perform(op_queue_[connect_op], ops); + fd_sets_[write_op].perform(op_queue_[connect_op], ops); +#endif // defined(BOOST_ASIO_WINDOWS) || defined(__CYGWIN__) // Exception operations must be processed first to ensure that any // out-of-band data is read before normal data. for (int i = max_select_ops - 1; i >= 0; --i) - op_queue_[i].perform_operations_for_descriptors(fd_sets_[i], ops); + fd_sets_[i].perform(op_queue_[i], ops); } timer_queues_.get_ready_timers(ops); } @@ -310,5 +310,6 @@ void select_reactor::cancel_ops_unlocked(socket_type descriptor, // || (!defined(BOOST_ASIO_HAS_DEV_POLL) // && !defined(BOOST_ASIO_HAS_EPOLL) // && !defined(BOOST_ASIO_HAS_KQUEUE)) + // && !defined(BOOST_ASIO_WINDOWS_RUNTIME)) #endif // BOOST_ASIO_DETAIL_IMPL_SELECT_REACTOR_IPP |