Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 386 Bytes

PH_S023.md

File metadata and controls

9 lines (5 loc) · 386 Bytes

PH_S023 - Monitor Lock in Async Method

Problem

The use of blocking synchronization mechanisms inside asynchronous methods, such as monitor locks, is discouraged, because there are more suitable asynchronous alternatives.

Solution

Do not use blocking synchronization primitives inside asynchronous methods. Prefer the use of the WaitAsync(...) of the SemaphoreSlim type.