Search Results for

    Show / Hide Table of Contents

    Class ManagedCountdownLatch

    A countdown latch that will signal when the counter reaches zero.

    Inheritance
    System.Object
    ManagedCountdownLatch
    Namespace: FM.LiveSwitch
    Assembly: FM.LiveSwitch.dll
    Syntax
    public class ManagedCountdownLatch : object

    Constructors

    ManagedCountdownLatch()

    Creates a new instance of the latch with an unknown count. This will cause the latch to count into the negatives until SetCount is called.

    Declaration
    public ManagedCountdownLatch()

    ManagedCountdownLatch(Int32)

    Creates a new instance of the latch with a count.

    Declaration
    public ManagedCountdownLatch(int initialCount)
    Parameters
    Type Name Description
    System.Int32 initialCount

    The initial counter value.

    Properties

    Count

    Gets the current count on the latch.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    Decrement()

    Decrements the counter by one and signals if it reaches zero.

    Declaration
    public void Decrement()

    Reset()

    Resets the latch with an unknown count. This will cause the latch to count into the negatives until SetCount is called.

    Declaration
    public void Reset()

    Reset(Int32)

    Resets the latch with a count.

    Declaration
    public void Reset(int initialCount)
    Parameters
    Type Name Description
    System.Int32 initialCount

    The initial counter value.

    SetCount(Int32)

    Sets the counter for the latch. This brings the count back up into positive numbers.

    Declaration
    public void SetCount(int count)
    Parameters
    Type Name Description
    System.Int32 count

    ToString()

    Generates a string description of this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    WaitAsync()

    Returns a promise that resolves once the counter reaches zero.

    Declaration
    public Future<object> WaitAsync()
    Returns
    Type Description
    Future<System.Object>

    WaitSync()

    Blocks until the counter reaches zero.

    Declaration
    public void WaitSync()
    In This Article
    Back to top Copyright © LiveSwitch Inc. All Rights Reserved. Doc build for LiveSwitch v1.15.0