Open
Description
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.