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 = valDeclaration
Swift
case xchg -
Add a value and return the old one
*ptr = *ptr + valDeclaration
Swift
case add -
Subtract a value and return the old one
*ptr = *ptr - valDeclaration
Swift
case sub -
And a value and return the old one
*ptr = *ptr & valDeclaration
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 | valDeclaration
Swift
case or -
Xor a value and return the old one
*ptr = *ptr ^ valDeclaration
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 : valDeclaration
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 : valDeclaration
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 : valDeclaration
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 : valDeclaration
Swift
case umin
AtomicReadModifyWriteOperation Enumeration Reference