The use of blocking synchronization mechanisms inside asynchronous methods, such as monitor locks, is discouraged, because there are more suitable asynchronous alternatives.
Do not use blocking synchronization primitives inside asynchronous methods. Prefer the use of the WaitAsync(...)
of the SemaphoreSlim
type.