Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Common.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ dotnet_diagnostic.SA1132.severity = warning
dotnet_diagnostic.SA1133.severity = suggestion

# Each attribute should be placed on its own line of code
dotnet_diagnostic.SA1134.severity = suggestion
dotnet_diagnostic.SA1134.severity = warning

# Using directive should be qualified
dotnet_diagnostic.SA1135.severity = suggestion
Expand Down
8 changes: 6 additions & 2 deletions src/MSBuildTaskHost/Concurrent/ConcurrentQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,16 @@ internal struct Slot
}
}
}

/// <summary>Padded head and tail indices, to avoid false sharing between producers and consumers.</summary>
[DebuggerDisplay("Head = {Head}, Tail = {Tail}")]
[StructLayout(LayoutKind.Explicit, Size = 192)] // padding before/between/after fields based on typical cache line size of 64
internal struct PaddedHeadAndTail
{
[FieldOffset(64)] public int Head;
[FieldOffset(128)] public int Tail;
[FieldOffset(64)]
public int Head;

[FieldOffset(128)]
public int Tail;
}
}