Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

UnsafeAtomicCounter64

struct in Unity.Collections.LowLevel.Unsafe

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A 64-bit atomic counter.

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.

Properties

Property Description
Counter The long that is modified by this counter.

Constructors

Constructor Description
UnsafeAtomicCounter64 Initializes and returns an instance of UnsafeAtomicCounter64.

Public Methods

Method Description
Add Atomically adds a value to this counter.
AddSat Atomically adds a value to this counter. The result will not be greater than a maximum value.
Reset Non-atomically sets this counter to a value.
Sub Atomically subtracts a value from this counter.
SubSat Atomically subtracts a value from this counter. The result will not be less than a minimum value.