Skip to main content

Uint32

No overview available.

Methods​


Load()​

@classmethod
def Load() - > uint32

Loads the current value of the Uint32. Callers use this to retrieve the integer value stored in the object.

Returns​

TypeDescription
uint32The current 32-bit unsigned integer value.

CompareAndSwap()​

@classmethod
def CompareAndSwap(
old: uint32,
new: uint32
) - > bool

Atomically compares the current value with 'old' and, if they are equal, replaces the current value with 'new'. This is used for concurrent updates to ensure data integrity.

Parameters​

NameTypeDescription
olduint32The expected current 32-bit unsigned integer value for the comparison.
newuint32The new 32-bit unsigned integer value to set if the comparison succeeds.

Returns​

TypeDescription
boolTrue if the swap was successful (i.e., the current value matched 'old'), False otherwise.

Add()​

@classmethod
def Add(
delta: uint32
) - > uint32

Atomically adds a delta to the current value and returns the new value. This is useful for incrementing counters safely in a concurrent environment.

Parameters​

NameTypeDescription
deltauint32The 32-bit unsigned integer value to add to the current value.

Returns​

TypeDescription
uint32The new 32-bit unsigned integer value after the addition.

Inc()​

@classmethod
def Inc() - > uint32

Atomically increments the current value by one and returns the new value. This is a convenience method for simple increments.

Returns​

TypeDescription
uint32The new 32-bit unsigned integer value after incrementing.

Store()​

@classmethod
def Store(
v: uint32
)

Atomically stores a new 32-bit unsigned integer value. Callers use this to set the object's value.

Parameters​

NameTypeDescription
vuint32The 32-bit unsigned integer value to store.