---
title: "logicalXor(_:ordering:)"
framework: synchronization
role: symbol
role_heading: Instance Method
path: "synchronization/atomic/logicalxor(_:ordering:)"
---

# logicalXor(_:ordering:)

Perform an atomic logical XOR operation and return the old and new value, applying the specified memory ordering.

## Declaration

```swift
@discardableResult func logicalXor(_ operand: Bool, ordering: AtomicUpdateOrdering) -> (oldValue: Bool, newValue: Bool)
```

## Parameters

- `operand`: A boolean value.
- `ordering`: The memory ordering to apply on this operation.

## Return Value

Return Value A tuple with the old value before the operation and the new value after the operation.
