Struct UnsafeAtomicCounter64 | Collections | 0.15.0-preview.21
docs.unity3d.com
    Show / Hide Table of Contents

    Struct UnsafeAtomicCounter64

    64-bit atomic counter.

    Namespace: Unity.Collections.LowLevel.Unsafe
    Syntax
    public struct UnsafeAtomicCounter64

    Constructors

    UnsafeAtomicCounter64(Void*)

    Constructor.

    Declaration
    public UnsafeAtomicCounter64(void *ptr)
    Parameters
    Type Name Description
    Void* ptr

    Pointer to counter data.

    Fields

    Counter

    Counter value.

    Declaration
    public long *Counter
    Field Value
    Type Description
    Int64*

    Methods

    Add(Int64)

    Adds value to counter.

    Declaration
    public long Add(long value)
    Parameters
    Type Name Description
    Int64 value

    Value to add to counter.

    Returns
    Type Description
    Int64

    AddSat(Int64, Int64)

    Add value to counter and saturate to maximum specified.

    Declaration
    public long AddSat(long value, long max = 9223372036854775807L)
    Parameters
    Type Name Description
    Int64 value

    Value to add to counter.

    Int64 max

    Maximum value of counter.

    Returns
    Type Description
    Int64

    Reset(Int64)

    Reset counter to value.

    Declaration
    public void Reset(long value = 0L)
    Parameters
    Type Name Description
    Int64 value

    Initial value.

    Sub(Int64)

    Subtract value from counter.

    Declaration
    public long Sub(long value)
    Parameters
    Type Name Description
    Int64 value

    Value to subtract from counter.

    Returns
    Type Description
    Int64

    SubSat(Int64, Int64)

    Subtract value from counter and staturate to minimum specified.

    Declaration
    public long SubSat(long value, long min = -9223372036854775808L)
    Parameters
    Type Name Description
    Int64 value

    Value to subtract from counter.

    Int64 min

    Minumum value of counter.

    Returns
    Type Description
    Int64
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023