Skip to content

Guide: withTimeout: missing info on statements being executed in atomically #2775

Open
@arberg

Description

@arberg

I'm learning, I read the withTimeout and it's claim that the second example will not leak resources. This can only be true if kotlin coroutines withTimeout guarantees that a statement is atomic, either it executes completely (including the assignment) or not at all. It would be nice if this was explicitly stated, and possibly with link to details if it's not so simple.
https://kotlinlang.org/docs/cancellation-and-timeouts.html

Otherwise really nice and clear writeup. Thank you to whoever wrote it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions