From 35eaff336074a2df524c062705bb942abc371a78 Mon Sep 17 00:00:00 2001 From: yann lei Date: Wed, 17 Jun 2026 00:05:38 +0930 Subject: [PATCH] Clarify ValueTask consumption guidance --- xml/System.Threading.Tasks/ValueTask.xml | 4 ++-- xml/System.Threading.Tasks/ValueTask`1.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xml/System.Threading.Tasks/ValueTask.xml b/xml/System.Threading.Tasks/ValueTask.xml index c4f9024cb94..f1f3f502ce1 100644 --- a/xml/System.Threading.Tasks/ValueTask.xml +++ b/xml/System.Threading.Tasks/ValueTask.xml @@ -74,9 +74,9 @@ using . A `ValueTask` instance may only be awaited once, and consumers may not call until the instance has completed. If these limitations are unacceptable, convert the `ValueTask` to a by calling . +A `ValueTask` instance may either be awaited or converted to a using . If the instance wraps a or a synchronous result, multiple awaits might succeed. However, a `ValueTask` instance can also be backed by a pooled , so consumers should treat an arbitrary `ValueTask` as single-consumption unless the provider explicitly documents support for multiple consumption. Consumers may not call until the instance has completed. If these limitations are unacceptable, convert the `ValueTask` to a by calling . -The following operations should never be performed on a `ValueTask` instance: +The following operations should not be performed on a `ValueTask` instance unless the provider explicitly documents that they are supported: - Awaiting the instance multiple times. - Calling multiple times. diff --git a/xml/System.Threading.Tasks/ValueTask`1.xml b/xml/System.Threading.Tasks/ValueTask`1.xml index c4db93b62f1..5e1ca3f2821 100644 --- a/xml/System.Threading.Tasks/ValueTask`1.xml +++ b/xml/System.Threading.Tasks/ValueTask`1.xml @@ -90,9 +90,9 @@ instance may either be awaited or converted to a using . A instance may only be awaited once, and consumers may not read until the instance has completed. If these limitations are unacceptable, convert the to a by calling . +A instance may either be awaited or converted to a using . If the instance wraps a or a synchronous result, multiple awaits might succeed. However, a instance can also be backed by a pooled , so consumers should treat an arbitrary as single-consumption unless the provider explicitly documents support for multiple consumption. Consumers may not read until the instance has completed. If these limitations are unacceptable, convert the to a by calling . -The following operations should never be performed on a instance: +The following operations should not be performed on a instance unless the provider explicitly documents that they are supported: - Awaiting the instance multiple times. - Calling multiple times.