Strands:使用线程而无需显式锁定
boost::asio::associated_executor_t<Handler> a = boost::asio::get_associated_executor(h);class my_handler
{
public:
// 自定义实现执行器类型要求。
typedef my_executor executor_type;
// 返回自定义执行器实现。
executor_type get_executor() const noexcept
{
return my_executor();
}
void operator()() { ... }
};Last updated