Commit 7dbbfad
committed
logger: make logger thread-safe
The commit replaces non-thread-safe `localtime` function call with
thread-safe `localtime_r` - it uses external buffer instead of internal
static one under the hood to achieve thread-safety.
Note that logger uses `std::cout` and `std::cerr` - to my surprise, they
are actually thread-safe, but parts of the messages sent from different
threads can get mixed. That's not great, but anyway the log is mostly
used to report errors, and they are pretty rare. So, as long as it is
not UB, such implementation is acceptable.
Part of #1101 parent 3ab2eff commit 7dbbfad
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
0 commit comments