is module ( std.experimental.logger) thread-safe.

ZombineDev via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Mar 10 15:56:14 PST 2016


On Sunday, 6 March 2016 at 09:54:49 UTC, Dsby wrote:
> I want to use the filelogger to my application.
> is the  sharedLog()  global and  thread-safe.

Yes, `FileLogger` internally uses `lockingTextWriter`, so it 
should be safe to call from multiple threads. Furthermore, the 
`sharedLog` property uses atomic load and store instructions, so 
it should be OK to concurrently change the shared logger.


More information about the Digitalmars-d-learn mailing list