term icon indicating copy to clipboard operation
term copied to clipboard

Use chrono to detect local timezone thread-safely

Open Techcable opened this issue 2 years ago • 0 comments

As discussed in PR #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?

This superceeds PR #44

Techcable avatar Feb 18 '24 23:02 Techcable