Skip to content

[Version 13.0] Feature support for Lock objects - #1770

Draft
RexJaeschke wants to merge 3 commits into
draft-v13from
v13-Lock-objects
Draft

[Version 13.0] Feature support for Lock objects#1770
RexJaeschke wants to merge 3 commits into
draft-v13from
v13-Lock-objects

Conversation

@RexJaeschke

Copy link
Copy Markdown
Contributor

This is Rex's adaptation of the corresponding MS proposal.

@RexJaeschke RexJaeschke added type: feature This issue describes a new feature Review: pending Proposal is available for review labels Aug 11, 2026
@RexJaeschke
RexJaeschke marked this pull request as draft August 11, 2026 10:59
@RexJaeschke RexJaeschke added this to the C# 13 milestone Aug 11, 2026
@KalleOlaviNiemitalo

Copy link
Copy Markdown
Contributor

A loophole occurs to me:

class C {
    void M() {
        var l = new System.Threading.Lock();
        lock (Launder(l)) {
        }
    }
    static object Launder<T>(T v) => v;
}

But that seems unlikely to happen by accident, and anyone doing it deliberately could just disable the warning instead.

BillWagner added a commit that referenced this pull request Aug 18, 2026
…objects

Source: #1770
Head SHA: 4e6c8e4

Apply lock objects feature patch from PR #1770 to alpha-v13.
3 files modified: conversions.md, standard-library.md, statements.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review: pending Proposal is available for review type: feature This issue describes a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants