microsoft / microsoft/vs-threading

Warn if affinity does not match base member

Open
#278 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

analyzers enhancement
Dominant language
C#
Stars
1k
Forks
160
Avg merge
1d 12h
Merged PRs (30d)
28

Description

An analyzer should be provided that reports a warning in the following situation:

  • A member d overrides a member x implements or implements an interface member y
  • d is thread-affinitized
  • x or y is not thread affinitized

This situation can easily occur when applying fixes to warnings reported by VSTHRD010. Failure to correct the base member as well will lead to situations where an invocation through the base member will not be detected by static analysis.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing VSTHRD010 analyzer and how it models thread affinity on overridden and interface members. Add coverage for the listed mismatch cases, with the warning emitted when an affinitized member's base or interface member is not affinitized.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.