You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C# 13 will warn when upcasting System.Threading.Lock to object in order to prevent accidentally using lock(object) rather than lock(Lock), and therefore calling Monitor.Enter/Monitor.Exit over the Lock object.
C# 13 will warn when upcasting
System.Threading.Lock
toobject
in order to prevent accidentally usinglock(object)
rather thanlock(Lock)
, and therefore callingMonitor.Enter
/Monitor.Exit
over theLock
object.https://github.com/dotnet/csharplang/blob/d0c84ab39867f28914180ce31099d5aefc3c8280/proposals/csharp-13.0/lock-object.md?plain=1#L72-L90
https://github.com/dotnet/csharplang/blob/main/meetings/2023/LDM-2023-12-04.md?plain=1#L35-L44
We should consider doing the same if other lock types are upcasted, such as
SemaphoreSlim
.The text was updated successfully, but these errors were encountered: