Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
The function[@boost:/doc/html/boost_asio/reference/make_strand.html `make_strand`]returns a strand constructed from an execution context or executor. When a [@boost:/doc/html/boost_asio/reference/strand.html `net::strand`] is chosen for the stream's executor, all completion handlers which do not already have an associated executor will use the strand. This is both a notational convenience (no need for函数用于从执行上下文或执行器构造一个串行器。当为流的执行器选择 [@boost:/doc/html/boost_asio/reference/strand.html `net::strand`] 时,所有尚未关联执行器的完成处理器都会使用该串行器。这种方式既简化代码写法(调用点无需使用 `strand::wrap`or或 `bind_executor`at call sites) and a measure of safety, as it is no longer possible to forget to use the strand.),也提高安全性,因为不会再出现忘记使用串行器的情况。