]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/asio/example/cpp03/tutorial/timer_dox.txt
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / asio / example / cpp03 / tutorial / timer_dox.txt
index 2a8eec6589b51eaa469802ba0a3c6c8fb7e44c20..18c454dc548be62b7f8d33448b7712e33ef21530 100644 (file)
@@ -1,5 +1,5 @@
 //
-// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2020 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)
@@ -21,9 +21,10 @@ header file.
 
 \until asio.hpp
 
-All programs that use asio need to have at least one boost::asio::io_context object.
-This class provides access to I/O functionality. We declare an object of this
-type first thing in the main function.
+All programs that use asio need to have at least one I/O execution context,
+such as an boost::asio::io_context or boost::asio::thread_pool object. An I/O execution
+context provides access to I/O functionality. We declare an object of type
+boost::asio::io_context first thing in the main function.
 
 \until boost::asio::io_context
 
@@ -287,7 +288,7 @@ Return to \ref tuttimer4
 /**
 \page tuttimer5 Timer.5 - Synchronising handlers in multithreaded programs
 
-This tutorial demonstrates the use of the boost::asio::io_context::strand class to
+This tutorial demonstrates the use of the boost::asio::strand class template to
 synchronise callback handlers in a multithreaded program.
 
 The previous four tutorials avoided the issue of handler synchronisation by
@@ -324,25 +325,25 @@ tutorial by running two timers in parallel.
 
 In addition to initialising a pair of boost::asio::steady_timer members, the
 constructor initialises the <tt>strand_</tt> member, an object of type
-boost::asio::io_context::strand.
+boost::asio::strand<boost::asio::io_context::executor_type>.
 
-An boost::asio::io_context::strand is an executor that guarantees that, for those
-handlers that are dispatched through it, an executing handler will be allowed
-to complete before the next one is started. This is guaranteed irrespective of
-the number of threads that are calling boost::asio::io_context::run(). Of course, the
-handlers may still execute concurrently with other handlers that were
-<b>not</b> dispatched through an boost::asio::io_context::strand, or were dispatched
-through a different boost::asio::io_context::strand object.
+The boost::asio::strand class template is an executor adapter that guarantees
+that, for those handlers that are dispatched through it, an executing handler
+will be allowed to complete before the next one is started. This is guaranteed
+irrespective of the number of threads that are calling
+boost::asio::io_context::run(). Of course, the handlers may still execute
+concurrently with other handlers that were <b>not</b> dispatched through an
+boost::asio::strand, or were dispatched through a different boost::asio::strand
+object.
 
 \until {
 
 When initiating the asynchronous operations, each callback handler is "bound"
-to an boost::asio::io_context::strand object. The
-boost::asio::io_context::strand::bind_executor() function returns a new handler that
-automatically dispatches its contained handler through the
-boost::asio::io_context::strand object. By binding the handlers to the same
-boost::asio::io_context::strand, we are ensuring that they cannot execute
-concurrently.
+to an boost::asio::strand<boost::asio::io_context::executor_type> object. The
+boost::asio::bind_executor() function returns a new handler that automatically
+dispatches its contained handler through the boost::asio::strand object. By
+binding the handlers to the same boost::asio::strand, we are ensuring that they
+cannot execute concurrently.
 
 \until }
 \until }