How to Release a Semaphore with a Using Block

added by tdupont
10/2/2016 4:29:12 PM

1 Kicks, 214 Views

I love that .NET has so many useful utilities available in the base framework. I often use the SemaphoreSlim, and I love that it supports async await. However, I don't like always having to create a try finally block around every use call to ensure that the release method gets called.