HavenDV / H.Pipes

A simple, easy to use, strongly-typed, async wrapper around .NET named pipes.
MIT License
219 stars 26 forks source link

SemaphoreFullException when CancellationToken is cancelled before semaphore is entered #24

Closed glausmichael closed 1 year ago

glausmichael commented 1 year ago

In PipeStreamWriter WriteAsync method, the semaphore is still released in the finally statement even it has not been entered if the cancellation token is cancelled before entering it. This leads to a SemaphoreFullException.