Skip to content

Atomicity updates for Thread Sanitizer warnings #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2023
Merged

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
2 participants