std.log version 2

Jonathan M Davis jmdavisProg at gmx.com
Sun Jun 5 23:21:52 PDT 2011


On 2011-06-05 22:58, Jonathan M Davis wrote:
> On 2011-06-05 22:25, Jose Armando Garcia wrote:
> > I filed a bug. I wasn't able to reproduce the problem I was having
> > with the class' shared static this ctr.
> > 
> > http://d.puremagic.com/issues/show_bug.cgi?id=6113
> 
> Well, if you're not seeing the problem with a shared static constructor,
> then that's definitely what I'm going to end up doing. However, we really
> need a reduced test case so that an appropriate bug can be filed for dmd.
> The current code in std.datetime _should_ work with your code. The fact
> that the singleton for UTC is current thread-local instead of shared
> should not matter one iota as far as initialization goes - particularly
> when immutable globals are effectively implicitly shared. So, I am going
> to change std.datetime so that its immutable singletons are shared, but we
> need a bug report with a small, reproducible test case (unrelated to
> std.datetime) which shows the initialization problem. Otherwise, it'll be
> a problem in the future for other code.

Actually, because immutable variables are implicitly shared, all is required 
is putting shared on the static constructors for the singletons. And I should 
have done that anyway, since there's already a bug about immutable variables 
being reinitialized when you put them in non-shared static constructors. It 
should probably be required that immutable global and class variables be 
initialized in shared constructors.

- Jonathan M Davis


More information about the Digitalmars-d mailing list