Show / Hide Table of Contents

Class AsyncCountdownEvent

Represents a synchronization primitive that is signaled when its count reaches zero.

Inheritance
Object
Synchronizer
AsyncCountdownEvent
Implements
IAsyncEvent
ISynchronizer
IDisposable
Inherited Members
Synchronizer.ISynchronizer.HasWaiters
Synchronizer.IsSet
Synchronizer.Wait(TimeSpan, CancellationToken)
Synchronizer.Dispose(Boolean)
Namespace: DotNext.Threading
Assembly: DotNext.Threading.dll
Syntax
public class AsyncCountdownEvent : Synchronizer, IAsyncEvent, ISynchronizer, IDisposable
Remarks

This is asynchronous version of .

Constructors

| Improve this Doc View Source

AsyncCountdownEvent(Int64)

Creates a new countdown event with the specified count.

Declaration
public AsyncCountdownEvent(long initialCount)
Parameters
Type Name Description
Int64 initialCount

The number of signals initially required to set the event.

Properties

| Improve this Doc View Source

CurrentCount

Gets the number of remaining signals required to set the event.

Declaration
public long CurrentCount { get; }
Property Value
Type Description
Int64
| Improve this Doc View Source

InitialCount

Gets the numbers of signals initially required to set the event.

Declaration
public long InitialCount { get; }
Property Value
Type Description
Int64

Methods

| Improve this Doc View Source

AddCount()

Increments the current count by one.

Declaration
public void AddCount()
| Improve this Doc View Source

AddCount(Int64)

Increments the current count by a specified value.

Declaration
public void AddCount(long signalCount)
Parameters
Type Name Description
Int64 signalCount

The value by which to increase CurrentCount.

| Improve this Doc View Source

Reset()

Resets the CurrentCount to the value of InitialCount.

Declaration
public bool Reset()
Returns
Type Description
Boolean

true, if state of this object changed from signaled to non-signaled state; otherwise, false.

| Improve this Doc View Source

Reset(Int64)

Resets the InitialCount property to a specified value.

Declaration
public bool Reset(long count)
Parameters
Type Name Description
Int64 count

The number of signals required to set this event.

Returns
Type Description
Boolean

true, if state of this object changed from signaled to non-signaled state; otherwise, false.

| Improve this Doc View Source

Signal()

Registers multiple signals with this object, decrementing the value of CurrentCount by one.

Declaration
public bool Signal()
Returns
Type Description
Boolean

true if the signals caused the count to reach zero and the event was set; otherwise, false.

| Improve this Doc View Source

Signal(Int64)

Registers multiple signals with this object, decrementing the value of CurrentCount by the specified amount.

Declaration
public bool Signal(long signalCount)
Parameters
Type Name Description
Int64 signalCount

The number of signals to register.

Returns
Type Description
Boolean

true if the signals caused the count to reach zero and the event was set; otherwise, false.

| Improve this Doc View Source

TryAddCount()

Attempts to increment the current count by one.

Declaration
public bool TryAddCount()
Returns
Type Description
Boolean

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

| Improve this Doc View Source

TryAddCount(Int64)

Attempts to increment the current count by a specified value.

Declaration
public bool TryAddCount(long signalCount)
Parameters
Type Name Description
Int64 signalCount

The value by which to increase CurrentCount.

Returns
Type Description
Boolean

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

Implements

IAsyncEvent
ISynchronizer
IDisposable

Extension Methods

AsyncEvent.Wait(IAsyncEvent, TimeSpan)
AsyncEvent.Wait(IAsyncEvent, CancellationToken)
AsyncEvent.Wait(IAsyncEvent)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, CancellationToken)
ExpressionBuilder.Const<T>(T)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, R1, R2>(T, Func<T, R1>, Func<T, R2>, out R1, out R2)
ObjectExtensions.Decompose<T, R1, R2>(T, ValueFunc<T, R1>, ValueFunc<T, R2>, out R1, out R2)
ObjectExtensions.Decompose<T, R1, R2>(T, Func<T, R1>, Func<T, R2>)
ObjectExtensions.Decompose<T, R1, R2>(T, ValueFunc<T, R1>, ValueFunc<T, R2>)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX