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

    Struct UnsafeAtomicCounter32

    32-bit atomic counter.

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

    Constructors

    UnsafeAtomicCounter32(Void*)

    Constructor.

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

    Pointer to counter data.

    Fields

    Counter

    Counter value.

    Declaration
    public int *Counter
    Field Value
    Type Description
    Int32*

    Methods

    Add(Int32)

    Adds value to counter.

    Declaration
    public int Add(int value)
    Parameters
    Type Name Description
    Int32 value

    Value to add to counter.

    Returns
    Type Description
    Int32

    AddSat(Int32, Int32)

    Add value to counter and saturate to maximum specified.

    Declaration
    public int AddSat(int value, int max = 2147483647)
    Parameters
    Type Name Description
    Int32 value

    Value to add to counter.

    Int32 max

    Maximum value of counter.

    Returns
    Type Description
    Int32

    Reset(Int32)

    Reset counter to value.

    Declaration
    public void Reset(int value = 0)
    Parameters
    Type Name Description
    Int32 value

    Initial value.

    Sub(Int32)

    Subtract value from counter.

    Declaration
    public int Sub(int value)
    Parameters
    Type Name Description
    Int32 value

    Value to subtract from counter.

    Returns
    Type Description
    Int32

    SubSat(Int32, Int32)

    Subtract value from counter and staturate to minimum specified.

    Declaration
    public int SubSat(int value, int min = -2147483648)
    Parameters
    Type Name Description
    Int32 value

    Value to subtract from counter.

    Int32 min

    Minumum value of counter.

    Returns
    Type Description
    Int32
    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