gpt4 book ai didi

kotlin - Kotlin 挂起函数处于等待状态和处于挂起状态之间有区别吗?

转载 作者:行者123 更新时间:2023-12-04 03:22:26 25 4
gpt4 key购买 nike

为了说明,docs对于挂起函数 delay 说:

Delays coroutine for a given time without blocking a thread and resumes it after a specified time.This suspending function is cancellable. If the Job of the current coroutine is cancelled or completed while this suspending function is waiting, this function immediately resumes with CancellationException. There is a prompt cancellation guarantee. If the job was cancelled while this function was suspended, it will not resume successfully.

在这个描述中,waitingsuspended 是同一个意思吗?或者是 waiting 处于不同于suspended 状态的挂起函数?

最佳答案

在这种情况下,“等待”没有具体含义(据我所知),我想说它肯定可以理解为“暂停”。本文档的两个部分都指的是同一个状态。

关于kotlin - Kotlin 挂起函数处于等待状态和处于挂起状态之间有区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68240312/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com