summaryrefslogtreecommitdiff
path: root/boost/beast/core/impl/buffered_read_stream.ipp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/beast/core/impl/buffered_read_stream.ipp')
-rw-r--r--boost/beast/core/impl/buffered_read_stream.ipp6
1 files changed, 5 insertions, 1 deletions
diff --git a/boost/beast/core/impl/buffered_read_stream.ipp b/boost/beast/core/impl/buffered_read_stream.ipp
index 1ae76b4d34..b199ea0687 100644
--- a/boost/beast/core/impl/buffered_read_stream.ipp
+++ b/boost/beast/core/impl/buffered_read_stream.ipp
@@ -18,6 +18,7 @@
#include <boost/beast/core/detail/config.hpp>
#include <boost/asio/associated_allocator.hpp>
#include <boost/asio/associated_executor.hpp>
+#include <boost/asio/executor_work_guard.hpp>
#include <boost/asio/handler_continuation_hook.hpp>
#include <boost/asio/handler_invoke_hook.hpp>
#include <boost/asio/post.hpp>
@@ -31,10 +32,12 @@ template<class MutableBufferSequence, class Handler>
class buffered_read_stream<
Stream, DynamicBuffer>::read_some_op
{
- int step_ = 0;
buffered_read_stream& s_;
+ boost::asio::executor_work_guard<decltype(
+ std::declval<Stream&>().get_executor())> wg_;
MutableBufferSequence b_;
Handler h_;
+ int step_ = 0;
public:
read_some_op(read_some_op&&) = default;
@@ -45,6 +48,7 @@ public:
buffered_read_stream& s,
MutableBufferSequence const& b)
: s_(s)
+ , wg_(s_.get_executor())
, b_(b)
, h_(std::forward<DeducedHandler>(h))
{