dotnet / dotnet/fsharp

Investigate: Special case Lock type in the lock function

Open
#17,287 7 comments 1 reaction 0 assignees View on GitHub
Area-Library Feature Request
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

As pointed out in https://github.com/dotnet/runtime/pull/103085#issuecomment-2150981294, lock shouldn't use new Lock type in the Monitor, as it might misbehave.

We can't use fslib special syntax for it to have separate implementation, since the type is not in the netstandard.

Two other ways for having its implementation separated for Lock and other types are

1. Make it a compiler intrinsic, which is probably a "no" for us.
2. Check the type in runtime, which might impact performance, since we'll have to use reflection for it, as well as might be a breaking change for some of the customers.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.