{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct UnsafeAtomicCounter32 | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct UnsafeAtomicCounter32

    A 32-bit atomic counter.

    Namespace: Unity.Collections.LowLevel.Unsafe
    Assembly: solution.dll
    Syntax
    public struct UnsafeAtomicCounter32
    Remarks

    Rather than have its own int, a counter points to an int. This arrangement lets counters in different jobs share reference to the same underlying int.

    Constructors

    Name Description
    UnsafeAtomicCounter32(void*)

    Initializes and returns an instance of UnsafeAtomicCounter32.

    Fields

    Name Description
    Counter

    The int that is modified by this counter.

    Methods

    Name Description
    Add(int)

    Atomically adds a value to this counter.

    AddSat(int, int)

    Atomically adds a value to this counter. The result will not be greater than a maximum value.

    Reset(int)

    Non-atomically sets this counter to a value.

    Sub(int)

    Atomically subtracts a value from this counter.

    SubSat(int, int)

    Atomically subtracts a value from this counter. The result will not be less than a minimum value.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)