Add checks and exceptions for multiple disposals of ComputeContext

このコミットが含まれているのは:
Sergio Pedri committed 2021-12-30 22:30:25 +01:00
1 親 a0428b4887
コミット 438280ad23
5ファイル変更
+81 -4

検索条件に一致するファイルはありません

+1
ファイルの表示
@@ -11,6 +11,7 @@
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)System\Collections.Generic\DictionaryExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Collections.Generic\QueueExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\MemberNotNullAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Enum.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\GC.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IntPtrExtensions.cs" />
@@ -0,0 +1,31 @@
namespace System.Diagnostics.CodeAnalysis;
/// <summary>
/// Specifies that the method or property will ensure that the listed field and property members have not-null values.
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
internal sealed class MemberNotNullAttribute : Attribute
{
/// <summary>
/// Initializes the attribute with a field or property member.
/// </summary>
/// <param name="member">The field or property member that is promised to be not-null.</param>
public MemberNotNullAttribute(string member)
{
Members = new[] { member };
}
/// <summary>
/// Initializes the attribute with the list of field and property members.
/// </summary>
/// <param name="members">The list of field and property members that are promised to be not-null.</param>
public MemberNotNullAttribute(params string[] members)
{
Members = members;
}
/// <summary>
/// Gets field or property member names.
/// </summary>
public string[] Members { get; }
}