Skip to content

src/chrono/timezones.nim is not thread safe #11

@ajusa

Description

@ajusa

The timezones are stored in a plain var at https://github.com/treeform/chrono/blob/master/src/chrono/timezones.nim#L52-L54, which makes it not thread safe. Eg, calling formatIso(ts, timezone) gives the dreaded gcsafe compiler error.

In practice, the timezones are set once at the start of a program so it's unlikely for threads to actually have an issue, but it would be good to fix that in the library instead of asking consumers to annotate each usage with .cast(gcsafe)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions