Skip to content

Commit e1e657c

Browse files
committed
update any restrictions on await
1 parent ea1164a commit e1e657c

File tree

1 file changed

+2
-2
lines changed
  • docs/csharp/language-reference/operators

1 file changed

+2
-2
lines changed

docs/csharp/language-reference/operators/await.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "await operator - asynchronously wait for a task to complete"
33
description: "The C# `await` operator asynchronously suspends evaluation of the enclosing `async` method."
4-
ms.date: 11/29/2022
4+
ms.date: 07/01/2024
55
f1_keywords:
66
- "await_CSharpKeyword"
77
helpviewer_keywords:
@@ -23,7 +23,7 @@ The preceding example uses the [async `Main` method](../../fundamentals/program-
2323
> [!NOTE]
2424
> For an introduction to asynchronous programming, see [Asynchronous programming with async and await](../../asynchronous-programming/index.md). Asynchronous programming with `async` and `await` follows the [task-based asynchronous pattern](../../../standard/asynchronous-programming-patterns/task-based-asynchronous-pattern-tap.md).
2525
26-
You can use the `await` operator only in a method, [lambda expression](lambda-expressions.md), or [anonymous method](delegate-operator.md) that is modified by the [async](../keywords/async.md) keyword. Within an async method, you can't use the `await` operator in the body of a synchronous function, inside the block of a [lock statement](../statements/lock.md), and in an [unsafe](../keywords/unsafe.md) context.
26+
You can use the `await` operator only in a method, [lambda expression](lambda-expressions.md), or [anonymous method](delegate-operator.md) that is modified by the [async](../keywords/async.md) keyword. Within an async method, you can't use the `await` operator in the body of a synchronous local function, inside the block of a [lock statement](../statements/lock.md), and in an [unsafe](../keywords/unsafe.md) context.
2727

2828
The operand of the `await` operator is usually of one of the following .NET types: <xref:System.Threading.Tasks.Task>, <xref:System.Threading.Tasks.Task%601>, <xref:System.Threading.Tasks.ValueTask>, or <xref:System.Threading.Tasks.ValueTask%601>. However, any awaitable expression can be the operand of the `await` operator. For more information, see the [Awaitable expressions](~/_csharpstandard/standard/expressions.md#12982-awaitable-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md).
2929

0 commit comments

Comments
 (0)