dotnet / dotnet/dotnet-api-docs

Add "Thread Safety" section for all types

Open
#9,793 1 comment 0 reactions 0 assignees View on GitHub
area-Meta documentation Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

Documentation for some types contains "Thread Safety" section.

For example, for the `System.String` type [it says](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0#thread-safety), that
> This type is thread safe.

and for some other types (like `List<>` [here](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1?view=net-8.0#thread-safety)) it is more descriptive.

But the documentation for many types does not contain this section at all, for example for `HashSet<>` [here](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1?view=net-8.0).

Does it mean, that the type should be treated as
> Public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

when the "Thread Safety" section does not exist in the documentation?

Otherwise, is it possible to add this section to all types?

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.