microsoft / VSSDK-Analyzers

Roslyn analyzers for Visual Studio extensions
MIT License
45 stars 28 forks source link

Ban AsyncSemaphore #257

Closed davkean closed 10 months ago

davkean commented 10 months ago

AsyncSemaphore is not JTF-aware, so waiting for this semaphore on the UI thread can hang Visual Studio if while on a background thread, an owner of the semaphore tries to switch to the UI thread. Given it is very difficult to ensure that this semaphore is not taken by the UI thread, ban it; ReentrantSemaphore is a good replacement.