We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ea7b39 commit bf325daCopy full SHA for bf325da
Tests/AtomicsTests/LockFreeSingleConsumerStack.swift
@@ -21,15 +21,13 @@ class LockFreeSingleConsumerStack<Element> {
21
}
22
typealias NodePtr = UnsafeMutablePointer<Node>
23
24
- private var _last = UnsafeAtomic<NodePtr?>.create(nil)
25
- private var _consumerCount = UnsafeAtomic<Int>.create(0)
+ private var _last = Atomic<NodePtr?>(nil)
+ private var _consumerCount = Atomic<Int>(0)
26
private var foo = 0
27
28
deinit {
29
// Discard remaining nodes
30
while let _ = pop() {}
31
- _last.destroy()
32
- _consumerCount.destroy()
33
34
35
// Push the given element to the top of the stack.
0 commit comments