std::future_status

std::future_status

Defined in header <future> - 定义于头文件 <future>

1. std::future_status

enum class future_status;

since C++11

enum class future_status {
    ready,
    timeout,
    deferred
};

Specifies state of a future as returned by wait_for and wait_until functions of std::future and std::shared_future.
指定 std::futurestd::shared_futurewait_forwait_until 函数所返回的 future 状态。

Return value for timed future operations - 定时 future 操作的返回值

This enum class type defines the possible return values of the wait_for and wait_until member functions of future and shared_future.
这种枚举类类型定义了 future and shared_futurewait_for and wait_until 成员函数的可能返回值。

future_status labelint valuedescription
future_status::ready0The function returned because the shared state was ready. - 共享状态就绪。
future_status::timeout1The function returned because the specified time was exhausted. - 共享状态在经过指定的时限时长前仍未就绪。
future_status::deferred2The function returned because the shared state contains a deferred function (see std::async). -共享状态含有延迟的函数,故将仅在显式请求时计算结果。

References

http://www.cplusplus.com/reference/future/future_status/
https://en.cppreference.com/w/cpp/thread/future_status

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Yongqiang Cheng

梦想不是浮躁,而是沉淀和积累。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值