[D-runtime] [D-Programming-Language/druntime] eddc04: Merge branch 'master' of git://github.com/ibuclaw/...

Sean Kelly sean at invisibleduck.org
Wed Oct 26 10:58:27 PDT 2011


I was just poking around in src/rt and noticed the .c files.  Must have marked fixing this as a "to do" item and forgot about it.  In any case, this is something I want to sort out for the next release, and I'm going to look into it today.

My initial guess about what's happening is that this is an artifact of the code using double-checked locking (there's an existing bug report about his the logic for this is broken) and optimization differences between DMD and DMC.  Seems like the easiest way to see if this is true is just to always do a double-lock instead of a DCL and see if the problem goes away, though the DCL stuff needs to be looked into and fixed regardless.

On Feb 6, 2011, at 8:35 PM, Brad Roberts wrote:

> Switching just monitor back to the c version gets win32 back in working shape.  So, exploring from there what's wrong, I
> went to a hybrid version, the .c file referencing the global variables (_monitor_critsec and inited) extern(C)'ed from
> the .d version.  Still works.  From there, I moved to using the .d version of _STI_monitor_staticctor.  That works for
> the druntime unit tests, but not for phobos' tests.
> 
> You can see the source of what I used here:
>  https://github.com/braddr/druntime/commits/win32-monitor-broken
> 
> The point where it works, with a mostly .c file:
>  https://github.com/braddr/druntime/commit/6c2f4d1b960c8f227a1ee033f072504a12d94e36
> 
> The point where I've moved the ctor to the .d file:
>  https://github.com/braddr/druntime/commit/7d43689996a63ee0195a55c8d3836edf5e59e6e6
> 
> So.. what am I missing?  Is there something special about win32 functions that start with an underscore?  Is there
> something special about win32 when it comes to linking one lib into another?  That it works for druntime's unittest and
> not phobos's is confusing to me.  I do next to no win32 programming (completely zero except for dmd), so I'm unfamiliar
> with any of it's idiosyncrasies.
> 
> Thanks,
> Brad
> 
> On 2/6/2011 4:47 PM, Brad Roberts wrote:
>> Grf.. I was afraid of that.. the win32 build is unhappy with these changes.  I'll dig in, but if anyone sees the problem
>> and wants to save me the time, shout.



More information about the D-runtime mailing list