2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-24 05:32:13 +00:00

Add a make_strand function.

The make_strand function creates a strand with a deduced Executor template
argument.
This commit is contained in:
Christopher Kohlhoff
2019-03-02 16:02:42 +11:00
parent 94743a1a96
commit 9eb153718d
9 changed files with 381 additions and 107 deletions

View File

@@ -17,7 +17,7 @@ class printer
{
public:
printer(boost::asio::io_context& io)
: strand_(io),
: strand_(boost::asio::make_strand(io)),
timer1_(io, boost::asio::chrono::seconds(1)),
timer2_(io, boost::asio::chrono::seconds(1)),
count_(0)
@@ -63,7 +63,7 @@ public:
}
private:
boost::asio::io_context::strand strand_;
boost::asio::strand<boost::asio::io_context::executor_type> strand_;
boost::asio::steady_timer timer1_;
boost::asio::steady_timer timer2_;
int count_;