Fix shadow variable warnings with g++ 4.6.
This commit is contained in:
parent
44add4d206
commit
bdc4559377
@ -65,7 +65,7 @@ public:
|
|||||||
|
|
||||||
// Recreate internal descriptors following a fork.
|
// Recreate internal descriptors following a fork.
|
||||||
ASIO_DECL void fork_service(
|
ASIO_DECL void fork_service(
|
||||||
asio::io_service::fork_event event);
|
asio::io_service::fork_event fork_ev);
|
||||||
|
|
||||||
// Initialise the task.
|
// Initialise the task.
|
||||||
ASIO_DECL void init_task();
|
ASIO_DECL void init_task();
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
|
|
||||||
// Recreate internal descriptors following a fork.
|
// Recreate internal descriptors following a fork.
|
||||||
ASIO_DECL void fork_service(
|
ASIO_DECL void fork_service(
|
||||||
asio::io_service::fork_event event);
|
asio::io_service::fork_event fork_ev);
|
||||||
|
|
||||||
// Initialise the task.
|
// Initialise the task.
|
||||||
ASIO_DECL void init_task();
|
ASIO_DECL void init_task();
|
||||||
|
@ -86,9 +86,9 @@ private:
|
|||||||
short events_;
|
short events_;
|
||||||
};
|
};
|
||||||
|
|
||||||
void dev_poll_reactor::fork_service(asio::io_service::fork_event event)
|
void dev_poll_reactor::fork_service(asio::io_service::fork_event fork_ev)
|
||||||
{
|
{
|
||||||
if (event == asio::io_service::fork_child)
|
if (fork_ev == asio::io_service::fork_child)
|
||||||
{
|
{
|
||||||
detail::mutex::scoped_lock lock(mutex_);
|
detail::mutex::scoped_lock lock(mutex_);
|
||||||
|
|
||||||
|
@ -86,9 +86,9 @@ void epoll_reactor::shutdown_service()
|
|||||||
timer_queues_.get_all_timers(ops);
|
timer_queues_.get_all_timers(ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
void epoll_reactor::fork_service(asio::io_service::fork_event event)
|
void epoll_reactor::fork_service(asio::io_service::fork_event fork_ev)
|
||||||
{
|
{
|
||||||
if (event == asio::io_service::fork_child)
|
if (fork_ev == asio::io_service::fork_child)
|
||||||
{
|
{
|
||||||
if (epoll_fd_ != -1)
|
if (epoll_fd_ != -1)
|
||||||
::close(epoll_fd_);
|
::close(epoll_fd_);
|
||||||
|
@ -76,9 +76,9 @@ void kqueue_reactor::shutdown_service()
|
|||||||
timer_queues_.get_all_timers(ops);
|
timer_queues_.get_all_timers(ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
void kqueue_reactor::fork_service(asio::io_service::fork_event event)
|
void kqueue_reactor::fork_service(asio::io_service::fork_event fork_ev)
|
||||||
{
|
{
|
||||||
if (event == asio::io_service::fork_child)
|
if (fork_ev == asio::io_service::fork_child)
|
||||||
{
|
{
|
||||||
// The kqueue descriptor is automatically closed in the child.
|
// The kqueue descriptor is automatically closed in the child.
|
||||||
kqueue_fd_ = -1;
|
kqueue_fd_ = -1;
|
||||||
|
@ -65,11 +65,11 @@ void resolver_service_base::shutdown_service()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void resolver_service_base::fork_service(
|
void resolver_service_base::fork_service(
|
||||||
asio::io_service::fork_event event)
|
asio::io_service::fork_event fork_ev)
|
||||||
{
|
{
|
||||||
if (work_thread_.get())
|
if (work_thread_.get())
|
||||||
{
|
{
|
||||||
if (event == asio::io_service::fork_prepare)
|
if (fork_ev == asio::io_service::fork_prepare)
|
||||||
{
|
{
|
||||||
work_io_service_->stop();
|
work_io_service_->stop();
|
||||||
work_thread_->join();
|
work_thread_->join();
|
||||||
|
@ -83,9 +83,9 @@ void select_reactor::shutdown_service()
|
|||||||
timer_queues_.get_all_timers(ops);
|
timer_queues_.get_all_timers(ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
void select_reactor::fork_service(asio::io_service::fork_event event)
|
void select_reactor::fork_service(asio::io_service::fork_event fork_ev)
|
||||||
{
|
{
|
||||||
if (event == asio::io_service::fork_child)
|
if (fork_ev == asio::io_service::fork_child)
|
||||||
interrupter_.recreate();
|
interrupter_.recreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ service_registry::~service_registry()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void service_registry::notify_fork(asio::io_service::fork_event event)
|
void service_registry::notify_fork(asio::io_service::fork_event fork_ev)
|
||||||
{
|
{
|
||||||
// Make a copy of all of the services while holding the lock. We don't want
|
// Make a copy of all of the services while holding the lock. We don't want
|
||||||
// to hold the lock while calling into each service, as it may try to call
|
// to hold the lock while calling into each service, as it may try to call
|
||||||
@ -73,12 +73,12 @@ void service_registry::notify_fork(asio::io_service::fork_event event)
|
|||||||
// services in the vector. For the other events we want to go in the other
|
// services in the vector. For the other events we want to go in the other
|
||||||
// direction.
|
// direction.
|
||||||
std::size_t num_services = services.size();
|
std::size_t num_services = services.size();
|
||||||
if (event == asio::io_service::fork_prepare)
|
if (fork_ev == asio::io_service::fork_prepare)
|
||||||
for (std::size_t i = 0; i < num_services; ++i)
|
for (std::size_t i = 0; i < num_services; ++i)
|
||||||
services[i]->fork_service(event);
|
services[i]->fork_service(fork_ev);
|
||||||
else
|
else
|
||||||
for (std::size_t i = num_services; i > 0; --i)
|
for (std::size_t i = num_services; i > 0; --i)
|
||||||
services[i - 1]->fork_service(event);
|
services[i - 1]->fork_service(fork_ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void service_registry::init_key(asio::io_service::service::key& key,
|
void service_registry::init_key(asio::io_service::service::key& key,
|
||||||
|
@ -145,13 +145,14 @@ void signal_set_service::shutdown_service()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void signal_set_service::fork_service(asio::io_service::fork_event event)
|
void signal_set_service::fork_service(
|
||||||
|
asio::io_service::fork_event fork_ev)
|
||||||
{
|
{
|
||||||
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
||||||
signal_state* state = get_signal_state();
|
signal_state* state = get_signal_state();
|
||||||
static_mutex::scoped_lock lock(state->mutex_);
|
static_mutex::scoped_lock lock(state->mutex_);
|
||||||
|
|
||||||
switch (event)
|
switch (fork_ev)
|
||||||
{
|
{
|
||||||
case asio::io_service::fork_prepare:
|
case asio::io_service::fork_prepare:
|
||||||
reactor_.deregister_internal_descriptor(
|
reactor_.deregister_internal_descriptor(
|
||||||
@ -178,7 +179,7 @@ void signal_set_service::fork_service(asio::io_service::fork_event event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
#else // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
||||||
(void)event;
|
(void)fork_ev;
|
||||||
#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
#endif // !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public:
|
|||||||
|
|
||||||
// Recreate internal descriptors following a fork.
|
// Recreate internal descriptors following a fork.
|
||||||
ASIO_DECL void fork_service(
|
ASIO_DECL void fork_service(
|
||||||
asio::io_service::fork_event event);
|
asio::io_service::fork_event fork_ev);
|
||||||
|
|
||||||
// Initialise the task.
|
// Initialise the task.
|
||||||
ASIO_DECL void init_task();
|
ASIO_DECL void init_task();
|
||||||
|
@ -48,7 +48,8 @@ public:
|
|||||||
ASIO_DECL void shutdown_service();
|
ASIO_DECL void shutdown_service();
|
||||||
|
|
||||||
// Perform any fork-related housekeeping.
|
// Perform any fork-related housekeeping.
|
||||||
ASIO_DECL void fork_service(asio::io_service::fork_event event);
|
ASIO_DECL void fork_service(
|
||||||
|
asio::io_service::fork_event fork_ev);
|
||||||
|
|
||||||
// Construct a new resolver implementation.
|
// Construct a new resolver implementation.
|
||||||
ASIO_DECL void construct(implementation_type& impl);
|
ASIO_DECL void construct(implementation_type& impl);
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
|
|
||||||
// Recreate internal descriptors following a fork.
|
// Recreate internal descriptors following a fork.
|
||||||
ASIO_DECL void fork_service(
|
ASIO_DECL void fork_service(
|
||||||
asio::io_service::fork_event event);
|
asio::io_service::fork_event fork_ev);
|
||||||
|
|
||||||
// Initialise the task, but only if the reactor is not in its own thread.
|
// Initialise the task, but only if the reactor is not in its own thread.
|
||||||
ASIO_DECL void init_task();
|
ASIO_DECL void init_task();
|
||||||
|
@ -58,7 +58,7 @@ public:
|
|||||||
ASIO_DECL ~service_registry();
|
ASIO_DECL ~service_registry();
|
||||||
|
|
||||||
// Notify all services of a fork event.
|
// Notify all services of a fork event.
|
||||||
ASIO_DECL void notify_fork(asio::io_service::fork_event event);
|
ASIO_DECL void notify_fork(asio::io_service::fork_event fork_ev);
|
||||||
|
|
||||||
// Get the service object corresponding to the specified service type. Will
|
// Get the service object corresponding to the specified service type. Will
|
||||||
// create a new service object automatically if no such object already
|
// create a new service object automatically if no such object already
|
||||||
|
@ -116,7 +116,8 @@ public:
|
|||||||
ASIO_DECL void shutdown_service();
|
ASIO_DECL void shutdown_service();
|
||||||
|
|
||||||
// Perform fork-related housekeeping.
|
// Perform fork-related housekeeping.
|
||||||
ASIO_DECL void fork_service(asio::io_service::fork_event event);
|
ASIO_DECL void fork_service(
|
||||||
|
asio::io_service::fork_event fork_ev);
|
||||||
|
|
||||||
// Construct a new signal_set implementation.
|
// Construct a new signal_set implementation.
|
||||||
ASIO_DECL void construct(implementation_type& impl);
|
ASIO_DECL void construct(implementation_type& impl);
|
||||||
|
Loading…
Reference in New Issue
Block a user