Skip to content

Commit

Permalink
Logger sharedLog comment on thread-safety
Browse files Browse the repository at this point in the history
fix Issue 16232 - std.experimental.logger.core.sharedLog isn't thread-safe
  • Loading branch information
burner committed May 7, 2017
1 parent 4788143 commit 7d7ce4a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions std/experimental/logger/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,9 @@ While getting and setting $(D sharedLog) is thread-safe, it has to be considered
that the returned reference is only a current snapshot and in the following
code, you must make sure no other thread reassigns to it between reading and
writing $(D sharedLog).
$(D sharedLog) is only thread-safe if the the used $(D Logger) is thread-safe.
The default $(D Logger) is thread-safe.
-------------
if (sharedLog !is myLogger)
sharedLog = new myLogger;
Expand Down

0 comments on commit 7d7ce4a

Please sign in to comment.