Search Results for

    Show / Hide Table of Contents

    Class InterlockedSpin

    INTERNAL! Implements helpers for performing Compare-and-swap operations using CompareExchange<T>(ref T, T, T) Note! Part of internal API. Breaking changes may occur without notice. Use at own risk.

    Inheritance
    object
    InterlockedSpin
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Util.Internal
    Assembly: Akka.dll
    Syntax
    public static class InterlockedSpin

    Methods

    | Edit this page View Source

    ConditionallySwap<T, TReturn>(ref T, Func<T, (bool, T, TReturn)>)

    INTERNAL! Atomically updates the int reference by calling updateIfTrue to get the new value. updateIfTrue returns a ValueTuple<should update, the new int value, the return value> If the first item in the tuple is true, the value is updated, and the third value of the tuple is returned. Note that updateIfTrue may be called many times so it should be idempotent. Note! Part of internal API. Breaking changes may occur without notice. Use at own risk.

    Declaration
    public static TReturn ConditionallySwap<T, TReturn>(ref T reference, Func<T, (bool, T, TReturn)> updateIfTrue) where T : class
    Parameters
    Type Name Description
    T reference

    TBD

    Func<T, (bool, T, TReturn)> updateIfTrue

    TBD

    Returns
    Type Description
    TReturn

    The third value from the tuple return by updateIfTrue.

    Type Parameters
    Name Description
    T

    TBD

    TReturn

    TBD

    | Edit this page View Source

    Swap<T>(ref T, Func<T, T>)

    INTERNAL! Atomically updates the object reference by calling updater to get the new value. Note that updater may be called many times so it should be idempotent. Note! Part of internal API. Breaking changes may occur without notice. Use at own risk.

    Declaration
    public static T Swap<T>(ref T reference, Func<T, T> updater) where T : class
    Parameters
    Type Name Description
    T reference

    TBD

    Func<T, T> updater

    TBD

    Returns
    Type Description
    T

    The updated value.

    Type Parameters
    Name Description
    T

    TBD

    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET