Skip to content

Fix unsafe handling of DateFormatter#6

Merged
jordanebelanger merged 1 commit intobrainfinance:masterfrom
sidepelican:thread_safety
Apr 24, 2024
Merged

Fix unsafe handling of DateFormatter#6
jordanebelanger merged 1 commit intobrainfinance:masterfrom
sidepelican:thread_safety

Conversation

@sidepelican
Copy link
Copy Markdown
Contributor

DateFormatter is not thread safe on Linux.
swiftlang/swift-corelibs-foundation#3166

It is better to use thread-local to reduce initialization costs while handling safely.

because DateFormatter is not thread safe on Linux
@jordanebelanger
Copy link
Copy Markdown
Collaborator

@sidepelican Are you having an actual problem with this? I've been running this on linux for years without ever incurring an issue related to this.

@sidepelican
Copy link
Copy Markdown
Contributor Author

Yes, I have encountered this in another case, not in this library, but in the same usage.

It's easy to reproduce the problem.
https://swiftfiddle.com/qmuoxrfh3jehjgvqee5tevdwhm

@jordanebelanger jordanebelanger merged commit bfa397b into brainfinance:master Apr 24, 2024
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.

2 participants