@@ -11,11 +11,10 @@ import kotlin.coroutines.*
1111 * This function is **not** equivalent to `deferreds.map { it.await() }` which fails only when it sequentially
1212 * gets to wait for the failing deferred, while this `awaitAll` fails immediately as soon as any of the deferreds fail.
1313 *
14- * This suspending function is cancellable.
15- * If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting,
16- * this function immediately resumes with [CancellationException].
17- * There is a **prompt cancellation guarantee**. If the job was cancelled while this function was
18- * suspended, it will not resume successfully. See [suspendCancellableCoroutine] documentation for low-level details.
14+ * This suspending function is cancellable: if the [Job] of the current coroutine is cancelled while this
15+ * suspending function is waiting, this function immediately resumes with [CancellationException].
16+ * There is a **prompt cancellation guarantee**: even if this function is ready to return the result, but was cancelled
17+ * while suspended, [CancellationException] will be thrown. See [suspendCancellableCoroutine] for low-level details.
1918 */
2019public suspend fun <T > awaitAll (vararg deferreds : Deferred <T >): List <T > =
2120 if (deferreds.isEmpty()) emptyList() else AwaitAll (deferreds).await()
@@ -28,11 +27,10 @@ public suspend fun <T> awaitAll(vararg deferreds: Deferred<T>): List<T> =
2827 * This function is **not** equivalent to `this.map { it.await() }` which fails only when it sequentially
2928 * gets to wait for the failing deferred, while this `awaitAll` fails immediately as soon as any of the deferreds fail.
3029 *
31- * This suspending function is cancellable.
32- * If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting,
33- * this function immediately resumes with [CancellationException].
34- * There is a **prompt cancellation guarantee**. If the job was cancelled while this function was
35- * suspended, it will not resume successfully. See [suspendCancellableCoroutine] documentation for low-level details.
30+ * This suspending function is cancellable: if the [Job] of the current coroutine is cancelled while this
31+ * suspending function is waiting, this function immediately resumes with [CancellationException].
32+ * There is a **prompt cancellation guarantee**: even if this function is ready to return the result, but was cancelled
33+ * while suspended, [CancellationException] will be thrown. See [suspendCancellableCoroutine] for low-level details.
3634 */
3735public suspend fun <T > Collection<Deferred<T>>.awaitAll (): List <T > =
3836 if (isEmpty()) emptyList() else AwaitAll (toTypedArray()).await()
@@ -41,23 +39,21 @@ public suspend fun <T> Collection<Deferred<T>>.awaitAll(): List<T> =
4139 * Suspends current coroutine until all given jobs are complete.
4240 * This method is semantically equivalent to joining all given jobs one by one with `jobs.forEach { it.join() }`.
4341 *
44- * This suspending function is cancellable.
45- * If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting,
46- * this function immediately resumes with [CancellationException].
47- * There is a **prompt cancellation guarantee**. If the job was cancelled while this function was
48- * suspended, it will not resume successfully. See [suspendCancellableCoroutine] documentation for low-level details.
42+ * This suspending function is cancellable: if the [Job] of the current coroutine is cancelled while this
43+ * suspending function is waiting, this function immediately resumes with [CancellationException].
44+ * There is a **prompt cancellation guarantee**: even if this function is ready to return the result, but was cancelled
45+ * while suspended, [CancellationException] will be thrown. See [suspendCancellableCoroutine] for low-level details.
4946 */
5047public suspend fun joinAll (vararg jobs : Job ): Unit = jobs.forEach { it.join() }
5148
5249/* *
5350 * Suspends current coroutine until all given jobs are complete.
5451 * This method is semantically equivalent to joining all given jobs one by one with `forEach { it.join() }`.
5552 *
56- * This suspending function is cancellable.
57- * If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting,
58- * this function immediately resumes with [CancellationException].
59- * There is a **prompt cancellation guarantee**. If the job was cancelled while this function was
60- * suspended, it will not resume successfully. See [suspendCancellableCoroutine] documentation for low-level details.
53+ * This suspending function is cancellable: if the [Job] of the current coroutine is cancelled while this
54+ * suspending function is waiting, this function immediately resumes with [CancellationException].
55+ * There is a **prompt cancellation guarantee**: even if this function is ready to return the result, but was cancelled
56+ * while suspended, [CancellationException] will be thrown. See [suspendCancellableCoroutine] for low-level details.
6157 */
6258public suspend fun Collection<Job>.joinAll (): Unit = forEach { it.join() }
6359
0 commit comments