AtomicReadModifyWriteOperation
public enum AtomicReadModifyWriteOperation
AtomicReadModifyWriteOperation
enumerates the kinds of supported atomic
read-write-modify operations.
-
Set the new value and return the one old
*ptr = val
Declaration
Swift
case xchg
-
Add a value and return the old one
*ptr = *ptr + val
Declaration
Swift
case add
-
Subtract a value and return the old one
*ptr = *ptr - val
Declaration
Swift
case sub
-
And a value and return the old one
*ptr = *ptr & val
Declaration
Swift
case and
-
Not-And a value and return the old one
*ptr = ~(*ptr & val)
Declaration
Swift
case nand
-
OR a value and return the old one
*ptr = *ptr | val
Declaration
Swift
case or
-
Xor a value and return the old one
*ptr = *ptr ^ val
Declaration
Swift
case xor
-
Sets the value if it’s greater than the original using a signed comparison and return the old one.
// Using a signed comparison *ptr = *ptr > val ? *ptr : val
Declaration
Swift
case max
-
Sets the value if it’s Smaller than the original using a signed comparison and return the old one.
// Using a signed comparison *ptr = *ptr < val ? *ptr : val
Declaration
Swift
case min
-
Sets the value if it’s greater than the original using an unsigned comparison and return the old one.
// Using an unsigned comparison *ptr = *ptr > val ? *ptr : val
Declaration
Swift
case umax
-
Sets the value if it’s greater than the original using an unsigned comparison and return the old one.
// Using an unsigned comparison *ptr = *ptr < val ? *ptr : val
Declaration
Swift
case umin