.NET includes synchronization types based on OS-level primitives, such as System.Threading.Semaphore
. Unless inter-process synchronization is necessary, they introduce unnecessary overhead. Furthermore, they do not provide an asynchronous API.
Replace the synchronization object with a suitable Slim counterpart, for example:
System.Threading.Semaphore
=>System.Threading.SemaphoreSlim
System.Threading.Mutex
=>System.Threading.SemaphoreSlim
System.Threading.ReaderWriterLock
=>System.Threading.ReaderWriterLockSlim
System.Threading.ManualResetEvent
=>System.Threading.ManualResetEventSlim
# Named synchronization primitives: ignore (default) / report
dotnet_diagnostic.PH_P012.named = ignore