std::this_thread::sync_wait
来自cppreference.com
< cpp | experimental | execution
在标头 <experimental/execution> 定义
|
||
auto sync_wait( execution::sender auto sender ) requires (/*always-sends-some-values*/(sender)) |
(C++26 起) | |
参数
sender | - | sync_wait 阻塞与其操作完成的发送器。 |
返回值
返回所提供的发送器在其工作完成时发送的各个值的可选元组。
注解
sync_wait
所返回的发送器与 ensure_started
相似,但它会阻塞当前 std::thread 或主线程直到其工作完成。
参阅
急切地启动一个发送器,它所返回的发送器将会把结果递交给其所连接并启动的接收器(如果有)。如果结果发送器未连接到接收器,或者结果操作状态并未启动,则忽略其结果。如果这种发送器在底层操作完成之前被销毁,则该操作脱离并继续执行。 (函数模板) |