diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/impl/kqueue_reactor.ipp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/detail/impl/kqueue_reactor.ipp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/impl/kqueue_reactor.ipp b/3rdParty/Boost/src/boost/asio/detail/impl/kqueue_reactor.ipp index 08209bd..3ac9eae 100644 --- a/3rdParty/Boost/src/boost/asio/detail/impl/kqueue_reactor.ipp +++ b/3rdParty/Boost/src/boost/asio/detail/impl/kqueue_reactor.ipp @@ -2,7 +2,7 @@ // detail/impl/kqueue_reactor.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) // Copyright (c) 2005 Stefan Arentz (stefan at soze dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -47,9 +47,9 @@ kqueue_reactor::kqueue_reactor(boost::asio::io_service& io_service) interrupter_(), shutdown_(false) { - // The interrupter is put into a permanently readable state. Whenever we - // want to interrupt the blocked kevent call we register a one-shot read - // operation against the descriptor. + // The interrupter is put into a permanently readable state. Whenever we want + // to interrupt the blocked kevent call we register a read operation against + // the descriptor. interrupter_.interrupt(); } @@ -139,17 +139,17 @@ void kqueue_reactor::start_op(int op_type, socket_type descriptor, { case read_op: BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); break; case write_op: BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_WRITE, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); break; case except_op: if (!descriptor_data->op_queue_[read_op].empty()) return; // Already registered for read events. BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, EV_OOBAND, 0, descriptor_data); + EV_ADD | EV_CLEAR, EV_OOBAND, 0, descriptor_data); break; } @@ -247,7 +247,7 @@ void kqueue_reactor::run(bool block, op_queue<operation>& ops) if (ptr == &interrupter_) { // No need to reset the interrupter since we're leaving the descriptor - // in a ready-to-read state and relying on one-shot notifications. + // in a ready-to-read state and relying on edge-triggered notifications. } else { @@ -296,18 +296,20 @@ void kqueue_reactor::run(bool block, op_queue<operation>& ops) case EVFILT_READ: if (!descriptor_data->op_queue_[read_op].empty()) BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); else if (!descriptor_data->op_queue_[except_op].empty()) BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_READ, - EV_ADD | EV_ONESHOT, EV_OOBAND, 0, descriptor_data); + EV_ADD | EV_CLEAR, EV_OOBAND, 0, descriptor_data); else continue; + break; case EVFILT_WRITE: if (!descriptor_data->op_queue_[write_op].empty()) BOOST_ASIO_KQUEUE_EV_SET(&event, descriptor, EVFILT_WRITE, - EV_ADD | EV_ONESHOT, 0, 0, descriptor_data); + EV_ADD | EV_CLEAR, 0, 0, descriptor_data); else continue; + break; default: break; } @@ -336,7 +338,7 @@ void kqueue_reactor::interrupt() { struct kevent event; BOOST_ASIO_KQUEUE_EV_SET(&event, interrupter_.read_descriptor(), - EVFILT_READ, EV_ADD | EV_ONESHOT, 0, 0, &interrupter_); + EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, &interrupter_); ::kevent(kqueue_fd_, &event, 1, 0, 0, 0); } |