Skip to content

Conversation

@bsneed
Copy link
Contributor

@bsneed bsneed commented Jun 27, 2023

private let lock = NSLock()
public class Atomic<T> {
private var value: T
private let queue = DispatchQueue(label: "com.segment.atomic.\(UUID().uuidString)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@bsneed bsneed merged commit fcd3e8d into main Jun 28, 2023
@bsneed bsneed deleted the bsneed/atomicity branch June 28, 2023 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thread Sanitizer: Swift access race in Segment.CountBasedFlushPolicy.count.modify : Swift.Int at 0x11a75f4c0

3 participants