Update AsyncBarrier.cs

This commit is contained in:
Lightczx
2024-06-17 09:57:21 +08:00
parent e8eed46d82
commit 75ea2b807f

View File

@@ -25,7 +25,7 @@ internal class AsyncBarrier
/// <param name="participants">The number of participants.</param>
public AsyncBarrier(int participants)
{
ArgumentOutOfRangeException.ThrowIfLessThan(participants, 1, "Participants of AsyncBarrier can not be less than 1");
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(participants, "Participants of AsyncBarrier must be greater than 0");
participantCount = participants;
// Allocate the stack so no resizing is necessary.