From 647583e86ad5caeaf363c015628466bbe76d5e49 Mon Sep 17 00:00:00 2001 From: natasha <5155395+murfel@users.noreply.github.com> Date: Mon, 21 Apr 2025 18:27:31 +0100 Subject: [PATCH] docs: fix example for channel, do not assume a single-threaded dispatcher --- kotlinx-coroutines-core/common/src/channels/Channel.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/kotlinx-coroutines-core/common/src/channels/Channel.kt b/kotlinx-coroutines-core/common/src/channels/Channel.kt index 3e3c0f5fae..25327d92f0 100644 --- a/kotlinx-coroutines-core/common/src/channels/Channel.kt +++ b/kotlinx-coroutines-core/common/src/channels/Channel.kt @@ -87,6 +87,7 @@ public interface SendChannel { * ``` * val channel = Channel() * launch { + * delay(100) * check(channel.receive() == 5) * } * channel.send(5) // suspends until 5 is received