-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Use the new lock in CoreLib #103085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the new lock in CoreLib #103085
Conversation
Tagging subscribers to this area: @mangod9 |
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadLocal.cs
Show resolved
Hide resolved
CI errors are known |
@kouvel I am just wondering - does F# have a special treatment for Lock too? Also, should Monitor.TryEnter throw an error if Lock object is passed? so other CIL languages could realize they need a special treatment here |
lock in F# is just a function, which takes a lock object and a function. No special treatment. |
From my understanding, the problem is - we now have this Lock type and it shouldn't be used (behind the scene) with Monitor type, otherwise if user defines a |
Yea that's a good point. I'm not sure if there's a way to disallow |
A run-time check adds a bit of measurable cost to locking, and if done in the |
No description provided.