Added typedef to hide platform-specific usage of select_interrupter.

This commit is contained in:
chris 2003-09-28 03:05:29 +00:00
parent 0174cb6e0c
commit 3a90b222d0
3 changed files with 41 additions and 7 deletions

View File

@ -37,9 +37,11 @@ nobase_include_HEADERS = \
asio/detail/reactive_socket_connector_service.hpp \ asio/detail/reactive_socket_connector_service.hpp \
asio/detail/reactive_stream_socket_service.hpp \ asio/detail/reactive_stream_socket_service.hpp \
asio/detail/reactor_op_queue.hpp \ asio/detail/reactor_op_queue.hpp \
asio/detail/select_interrupter.hpp \
asio/detail/select_reactor.hpp \ asio/detail/select_reactor.hpp \
asio/detail/service_registry.hpp \ asio/detail/service_registry.hpp \
asio/detail/shared_thread_demuxer_service.hpp \ asio/detail/shared_thread_demuxer_service.hpp \
asio/detail/signal_init.hpp \
asio/detail/socket_holder.hpp \ asio/detail/socket_holder.hpp \
asio/detail/socket_ops.hpp \ asio/detail/socket_ops.hpp \
asio/detail/socket_select_interrupter.hpp \ asio/detail/socket_select_interrupter.hpp \

View File

@ -0,0 +1,37 @@
//
// select_interrupter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003 Christopher M. Kohlhoff (chris@kohlhoff.com)
//
// Permission to use, copy, modify, distribute and sell this software and its
// documentation for any purpose is hereby granted without fee, provided that
// the above copyright notice appears in all copies and that both the copyright
// notice and this permission notice appear in supporting documentation. This
// software is provided "as is" without express or implied warranty, and with
// no claim as to its suitability for any purpose.
//
#ifndef ASIO_DETAIL_SELECT_INTERRUPTER_HPP
#define ASIO_DETAIL_SELECT_INTERRUPTER_HPP
#include "asio/detail/push_options.hpp"
#include "asio/detail/pipe_select_interrupter.hpp"
#include "asio/detail/socket_select_interrupter.hpp"
namespace asio {
namespace detail {
#if defined(_WIN32)
typedef socket_select_interrupter select_interrupter;
#else
typedef pipe_select_interrupter select_interrupter;
#endif
} // namespace detail
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_DETAIL_SELECT_INTERRUPTER_HPP

View File

@ -22,9 +22,8 @@
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include "asio/detail/pop_options.hpp" #include "asio/detail/pop_options.hpp"
#include "asio/detail/pipe_select_interrupter.hpp"
#include "asio/detail/reactor_op_queue.hpp" #include "asio/detail/reactor_op_queue.hpp"
#include "asio/detail/socket_select_interrupter.hpp" #include "asio/detail/select_interrupter.hpp"
#include "asio/detail/socket_types.hpp" #include "asio/detail/socket_types.hpp"
namespace asio { namespace asio {
@ -181,11 +180,7 @@ private:
boost::mutex mutex_; boost::mutex mutex_;
// The interrupter is used to break a blocking select call. // The interrupter is used to break a blocking select call.
#if defined(_WIN32) select_interrupter interrupter_;
socket_select_interrupter interrupter_;
#else
pipe_select_interrupter interrupter_;
#endif
// The queue of read operations. // The queue of read operations.
reactor_op_queue<socket_type> read_op_queue_; reactor_op_queue<socket_type> read_op_queue_;