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' and was updated to 'new'), otherwise False.

Add()

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

Atomically adds the 'delta' value to the current Uint32 value and returns the new value. This is useful for atomically incrementing a counter.

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 Uint32 value by one and returns the new value. This is a convenience method for simple atomic increments.

Returns

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

Store()

@classmethod
def Store(
v: uint32
)

Atomically stores the provided 32-bit unsigned integer value into the Uint32. Callers use this to set the integer value of the object.

Parameters

NameTypeDescription
vuint32The 32-bit unsigned integer value to store.