From bd92ebd1a8b7ba61ef39f060ef179b439609955a Mon Sep 17 00:00:00 2001 From: Matthew Thomas Date: Sat, 25 Jun 2022 19:49:33 -0400 Subject: [PATCH] Update AsyncLock.md --- doc/AsyncLock.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/AsyncLock.md b/doc/AsyncLock.md index c90b2af..c1f9270 100644 --- a/doc/AsyncLock.md +++ b/doc/AsyncLock.md @@ -1,6 +1,6 @@ ## Overview -This is the `async`-ready almost-equivalent of the `lock` keyword or the [`Mutex` type](https://docs.microsoft.com/en-us/dotnet/api/system.threading.mutex), similar to Stephen Toub's [AsyncLock](https://blogs.msdn.microsoft.com/pfxteam/2012/02/12/building-async-coordination-primitives-part-6-asynclock/). It's only _almost_ equivalent because the `lock` keyword permits reentrancy, which is not currently possible to do with an `async`-ready lock. +This is the `async`-ready almost-equivalent of the `lock` keyword or the [`Mutex` type](https://docs.microsoft.com/en-us/dotnet/api/system.threading.mutex), similar to Stephen Toub's [AsyncLock](https://blogs.msdn.microsoft.com/pfxteam/2012/02/12/building-async-coordination-primitives-part-6-asynclock/). It's only _almost_ equivalent because this does not permit reentrance like the `lock` keyword. An `AsyncLock` is either taken or not. The lock can be asynchronously acquired by calling `LockAsync`, and it is released by disposing the result of that task. `AsyncLock` taken an optional `CancellationToken`, which can be used to cancel the acquiring of the lock.