Skip to content
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

Use chrono to detect local timezone thread-safely #48

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 18, 2024

  1. Use chrono to detect local timezone thread-safely

    As discussed in PR slog-rs#44, the 'time' crate fails timezine detection
    in the prsesense of multiple threads, because the underlying
    POSIX function localtime_r is not thread safe (at least not on Linux).
    
    In order to avoid these thread-safety issues,
    we use the chrono crate. It avoids system libraries
    and reimplements timezone detection from scratch.
    (Thanks to @yaozongyou for pointing this out)
    
    TODO: Maybe we should switch to chono entirely.
    It seems to be a fairly complete replacement.
    What are the advantages & disadvantages?
    Techcable committed Feb 18, 2024
    Configuration menu
    Copy the full SHA
    4465f02 View commit details
    Browse the repository at this point in the history