# HG changeset patch # User Tomas Lindquist Olsen # Date 1217163784 -7200 # Node ID 8d62834490d857ebe1a537ea041e8c49e634edfc # Parent dc7dff3ce72efd0576d0d3732ca2eec07905d96c Fixed (I hope) problem with monitor/synchronized stuff not being properly initialized on Windows. diff -r dc7dff3ce72e -r 8d62834490d8 tango/lib/compiler/llvmdc/dmain2.d --- a/tango/lib/compiler/llvmdc/dmain2.d Sun Jul 27 14:32:51 2008 +0200 +++ b/tango/lib/compiler/llvmdc/dmain2.d Sun Jul 27 15:03:04 2008 +0200 @@ -87,13 +87,12 @@ void _d_criticalInit() { - version (linux) - { - _STI_monitor_staticctor(); - _STI_critical_init(); - } + _STI_monitor_staticctor(); + _STI_critical_init(); } +// this is here so users can manually initialize the runtime +// for example, when there is no main function etc. extern (C) bool rt_init( void delegate( Exception ) dg = null ) { _d_criticalInit(); @@ -119,13 +118,12 @@ void _d_criticalTerm() { - version (linux) - { - _STD_critical_term(); - _STD_monitor_staticdtor(); - } + _STD_critical_term(); + _STD_monitor_staticdtor(); } +// this is here so users can manually terminate the runtime +// for example, when there is no main function etc. extern (C) bool rt_term( void delegate( Exception ) dg = null ) { try @@ -168,12 +166,9 @@ char[][] args; int result; - version (linux) - { - debug(PRINTF) printf("main ctors\n"); - _STI_monitor_staticctor(); - _STI_critical_init(); - } + debug(PRINTF) printf("main ctors\n"); + _STI_monitor_staticctor(); + _STI_critical_init(); debug(PRINTF) printf("main args\n"); version (Win32) @@ -288,11 +283,9 @@ tryExec(&runAll); - version (linux) - { - debug(PRINTF) printf("main dtor\n"); - _STD_critical_term(); - _STD_monitor_staticdtor(); - } + debug(PRINTF) printf("main dtor\n"); + _STD_critical_term(); + _STD_monitor_staticdtor(); + return result; }