``` suspend fun apple() { "some work" ...
# coroutines
t
Copy code
suspend fun apple() {
        "some work"
        banana() // suspension point?
        delay(2) // suspension point
        "some work"
        yield() // suspension point
    }

    suspend fun banana() {
        "doing some work"
    }
A suspension point — is a point during coroutine execution where the execution of the coroutine may be suspended. Syntactically, a suspension point is an invocation of suspending function, but the actual suspension happens when the suspending function invokes the standard library primitive to suspend the execution. Help me understand this please. In the above code sample does the call to banana() is potentially suspension point even thought banana itself does not have any suspend points inside?
b
No, banana call is not an actual suspension point, so 1. Caller's execution won't be suspended when calling it 2. Cancellation wont be thrown
1
t
thanks
k
Suspension points bottom out in suspendCancellableCoroutine in the kotlinx library. This is the thing that actually suspends the coroutine you’re on. Likewise, this call checks for cancellation as well.
This function throws a CancellationException if the Job of the coroutine is cancelled or completed while it is suspended.
every suspend function that actually suspends and is cancellable ends up calling that function. Even ‘special’ ones like delay.