-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathMSBuildMultiThreadableTaskAttribute.cs
More file actions
38 lines (35 loc) · 1.59 KB
/
Copy pathMSBuildMultiThreadableTaskAttribute.cs
File metadata and controls
38 lines (35 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#nullable enable
using System;
namespace Microsoft.Build.Framework
{
/// <summary>
/// Attribute that marks a task class as thread-safe for multithreaded execution.
/// </summary>
/// <remarks>
/// Task classes marked with this attribute indicate they can be safely executed in parallel
/// in the same process with other tasks.
///
/// Tasks using this attribute must satisfy strict requirements:
/// - Must not modify global process state (environment variables, working directory, etc.)
/// - Must not depend on global process state, including relative path resolution
/// - Must safely handle registered task objects shared across thread nodes
///
/// MSBuild detects this attribute by its namespace and name only, ignoring the defining assembly.
/// This allows customers to define the attribute in their own assemblies alongside their tasks.
///
/// When defining polyfilled versions of this attribute in customer assemblies,
/// they must also specify Inherited = false to ensure proper non-inheritable semantics.
/// </remarks>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public class MSBuildMultiThreadableTaskAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the MSBuildMultiThreadableTaskAttribute class.
/// </summary>
public MSBuildMultiThreadableTaskAttribute()
{
}
}
}