Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UnsafeAtomicCounter64

A 64-bit atomic counter.
Read time 1 minuteLast updated 20 days ago

Definition

public struct UnsafeAtomicCounter64

Remarks

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

Fields

Value

Description

CounterThe long that is modified by this counter.

Constructors

Constructor

Description

UnsafeAtomicCounter64(System.Void*)Initializes and returns an instance of UnsafeAtomicCounter64.

Methods

Method

Description

AddAtomically adds a value to this counter.
AddSatAtomically adds a value to this counter. The result will not be greater than a maximum value.
ResetNon-atomically sets this counter to a value.
SubAtomically subtracts a value from this counter.
SubSatAtomically subtracts a value from this counter. The result will not be less than a minimum value.