TryAddCount Method (Int32)

Task Parallel System.Threading

Attempts to increment the CountdownEvent's current count by a specified value.

Namespace:  System.Threading
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Function TryAddCount ( _
	signalCount As Integer _
) As Boolean
C#
public bool TryAddCount(
	int signalCount
)

Parameters

signalCount
Type: System..::.Int32
The value by which to increase CurrentCount.

Return Value

true if the increment succeeded; otherwise, false. If CurrentCount is already at zero this will return false.

Exceptions

ExceptionCondition
System..::.ArgumentOutOfRangeExceptionsignalCount is less than 0.
System..::.InvalidOperationExceptionThe current instance is already set.
System..::.InvalidOperationExceptionCurrentCount is equal to MaxValue.
System..::.ObjectDisposedExceptionThe current instance has already been disposed.

See Also