summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-19 20:22:58 (GMT)
committerTobias Markmann <tm@ayena.de>2014-10-20 13:49:33 (GMT)
commit6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch)
tree2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp
parent38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff)
downloadswift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip
swift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0. Updated our update.sh script to stop on error. Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to missing include of <iostream> with newer Boost. Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp')
-rw-r--r--3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp59
1 files changed, 48 insertions, 11 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp b/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp
index d82da22..0ff28ed 100644
--- a/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp
+++ b/3rdParty/Boost/src/boost/asio/detail/wrapped_handler.hpp
@@ -2,7 +2,7 @@
// detail/wrapped_handler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// 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)
@@ -17,6 +17,7 @@
#include <boost/asio/detail/bind_handler.hpp>
#include <boost/asio/detail/handler_alloc_helpers.hpp>
+#include <boost/asio/detail/handler_cont_helpers.hpp>
#include <boost/asio/detail/handler_invoke_helpers.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -25,7 +26,26 @@ namespace boost {
namespace asio {
namespace detail {
-template <typename Dispatcher, typename Handler>
+struct is_continuation_delegated
+{
+ template <typename Dispatcher, typename Handler>
+ bool operator()(Dispatcher&, Handler& handler) const
+ {
+ return boost_asio_handler_cont_helpers::is_continuation(handler);
+ }
+};
+
+struct is_continuation_if_running
+{
+ template <typename Dispatcher, typename Handler>
+ bool operator()(Dispatcher& dispatcher, Handler&) const
+ {
+ return dispatcher.running_in_this_thread();
+ }
+};
+
+template <typename Dispatcher, typename Handler,
+ typename IsContinuation = is_continuation_delegated>
class wrapped_handler
{
public:
@@ -53,7 +73,7 @@ public:
void operator()()
{
- dispatcher_.dispatch(handler_);
+ dispatcher_.dispatch(BOOST_ASIO_MOVE_CAST(Handler)(handler_));
}
void operator()() const
@@ -181,34 +201,43 @@ public:
Handler handler_;
};
-template <typename Dispatcher, typename Handler>
+template <typename Dispatcher, typename Handler, typename IsContinuation>
inline void* asio_handler_allocate(std::size_t size,
- wrapped_handler<Dispatcher, Handler>* this_handler)
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
{
return boost_asio_handler_alloc_helpers::allocate(
size, this_handler->handler_);
}
-template <typename Dispatcher, typename Handler>
+template <typename Dispatcher, typename Handler, typename IsContinuation>
inline void asio_handler_deallocate(void* pointer, std::size_t size,
- wrapped_handler<Dispatcher, Handler>* this_handler)
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
{
boost_asio_handler_alloc_helpers::deallocate(
pointer, size, this_handler->handler_);
}
-template <typename Function, typename Dispatcher, typename Handler>
+template <typename Dispatcher, typename Handler, typename IsContinuation>
+inline bool asio_handler_is_continuation(
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
+{
+ return IsContinuation()(this_handler->dispatcher_, this_handler->handler_);
+}
+
+template <typename Function, typename Dispatcher,
+ typename Handler, typename IsContinuation>
inline void asio_handler_invoke(Function& function,
- wrapped_handler<Dispatcher, Handler>* this_handler)
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
{
this_handler->dispatcher_.dispatch(
rewrapped_handler<Function, Handler>(
function, this_handler->handler_));
}
-template <typename Function, typename Dispatcher, typename Handler>
+template <typename Function, typename Dispatcher,
+ typename Handler, typename IsContinuation>
inline void asio_handler_invoke(const Function& function,
- wrapped_handler<Dispatcher, Handler>* this_handler)
+ wrapped_handler<Dispatcher, Handler, IsContinuation>* this_handler)
{
this_handler->dispatcher_.dispatch(
rewrapped_handler<Function, Handler>(
@@ -231,6 +260,14 @@ inline void asio_handler_deallocate(void* pointer, std::size_t size,
pointer, size, this_handler->context_);
}
+template <typename Dispatcher, typename Context>
+inline bool asio_handler_is_continuation(
+ rewrapped_handler<Dispatcher, Context>* this_handler)
+{
+ return boost_asio_handler_cont_helpers::is_continuation(
+ this_handler->context_);
+}
+
template <typename Function, typename Handler, typename Context>
inline void asio_handler_invoke(Function& function,
rewrapped_handler<Handler, Context>* this_handler)