Dotnext Threading

Async synchronization primitives from the DotNext.Threading NuGet package - async exclusive and reader/writer locks (with sync acquisition for mixed callers), auto/manual reset events, countdown event, barrier, AsyncTrigger, awaiting WaitHandle/CancellationToken, and custom primitives via QueuedSynchronizer<T>. Use when writing async .NET code that needs mutual exclusion or signaling without blocking threads, or that must await a WaitHandle or a CancellationToken; and when converting lock/Monitor, Monitor.Wait/Pulse, ReaderWriterLockSlim, ManualResetEventSlim, AutoResetEvent, CountdownEvent, Barrier or WaitHandle.WaitOne to async, e.g. after "CS1996 cannot await in the body of a lock statement".

.NET (Microsoft) Updated 22.1k repo stars

File contents

dotnet/dotnext commit 7f32ea9abc

Frequently asked questions

npx get-skill add dotnet/dotnext-threading