2007-09-12 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Wed, 12 Sep 2007 12:41:40 +0000 (12:41 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 12 Sep 2007 12:41:40 +0000 (12:41 -0000)
            * io-portability.c Do not initialize portability helpers here, it's done in
            mono_runtime_init.

2007-09-12  Marek Habersack  <mhabersack@novell.com>

            * appdomain.c (mono_runtime_init): init portability helpers here.

svn path=/trunk/mono/; revision=85682

mono/io-layer/ChangeLog
mono/io-layer/io-portability.c
mono/metadata/ChangeLog
mono/metadata/appdomain.c
mono/utils/mono-io-portability.c
mono/utils/mono-io-portability.h

index f1478b4a81d4f64fd24d96e7463f46b8ee5c4e85..8ff8cbd39624dc7940f6a1c2023b94dd4877b147 100644 (file)
@@ -2,6 +2,8 @@
 
        * io-portability.c: options_init moved to
        utils/mono-io-portability.c
+       Do not initialize portability helpers here, it's done in
+       mono_runtime_init.
 
 2007-09-09  Robert Jordan  <robertj@gmx.net>
 
index 13b54ce2d0c333b49a84cbaead5440ecc204f757..25b04ae7f238e02f2c28806acec5ede520972a24 100644 (file)
@@ -74,8 +74,6 @@ static gchar *find_file (const gchar *pathname, gboolean last_exists)
        int num_components = 0, component = 0;
        DIR *scanning = NULL;
 
-       mono_portability_helpers_init ();
-
        if (IS_PORTABILITY_NONE) {
                return(NULL);
        }
@@ -571,8 +569,6 @@ gchar *_wapi_basename (const gchar *filename)
 {
        gchar *new_filename = g_strdup (filename), *ret;
 
-       mono_portability_helpers_init ();
-       
        g_strdelimit (new_filename, "\\", '/');
 
        if (IS_PORTABILITY_DRIVE &&
@@ -594,8 +590,6 @@ gchar *_wapi_dirname (const gchar *filename)
 {
        gchar *new_filename = g_strdup (filename), *ret;
 
-       mono_portability_helpers_init ();
-       
        g_strdelimit (new_filename, "\\", '/');
 
        if (IS_PORTABILITY_DRIVE &&
index f97bee0fe1d90d5036eaa8eff90e6f8d24807130..076018825350517e42a98e1337fa14a3409c81ee 100644 (file)
@@ -5,6 +5,7 @@
        trigger the AppDomain.AssemblyResolve event.
        (mono_try_assembly_resolve): renamed from try_assembly_resolve and
        made non-static.
+       (mono_runtime_init): init portability helpers here.
 
        * assembly.c (mono_assembly_load_with_partial_name): if other   
        attempts fail, trigger the AppDomain.AssemblyResolve event handler
index f1955cc528ac09d46f475316ed170ca440ceee9f..195a792b7a464e5c8c0fd993bee0f7790adf2570 100644 (file)
@@ -39,6 +39,7 @@
 #include <mono/utils/mono-logger.h>
 #include <mono/utils/mono-path.h>
 #include <mono/utils/mono-stdlib.h>
+#include <mono/utils/mono-io-portability.h>
 #ifdef PLATFORM_WIN32
 #include <direct.h>
 #endif
@@ -101,6 +102,8 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
        MonoAppDomain *ad;
        MonoClass *class;
        MonoString *arg;
+
+       mono_portability_helpers_init ();
        
        MONO_GC_PRE_INIT ();
        mono_monitor_init ();
@@ -156,7 +159,7 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
 
        /* mscorlib is loaded before we install the load hook */
        mono_domain_fire_assembly_load (mono_defaults.corlib->assembly, NULL);
-
+       
        return;
 }
 
index eb1691c7e1095af06a9b9a9adeab9720c2223edb..e8e6c3fd0b92e204f99381789b56d590932d198e 100644 (file)
@@ -1,16 +1,17 @@
 #include "config.h"
 
 #include <glib.h>
-#include <mono/io-layer/mono-mutex.h>
 #include <mono/utils/mono-io-portability.h>
 
-static mono_once_t options_once = MONO_ONCE_INIT;
 int __mono_io_portability_helpers = PORTABILITY_UNKNOWN;
 
-static void options_init (void)
+void mono_portability_helpers_init (void)
 {
         const gchar *env;
-        
+
+       if (__mono_io_portability_helpers != PORTABILITY_UNKNOWN)
+               return;
+       
         __mono_io_portability_helpers = PORTABILITY_NONE;
         
         env = g_getenv ("MONO_IOMAP");
@@ -42,9 +43,3 @@ static void options_init (void)
                 }
         }
 }
-
-void mono_portability_helpers_init ()
-{
-       mono_once (&options_once, options_init);
-}
-
index d86dad0cb946f9613688a12bfd8952c6dc722934..fc9de6ba7d5ba1181e2b09273eae91b44cf202a3 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __MONO_URI_H
-#define __MONO_URI_H
+#ifndef __MONO_IO_PORTABILITY_H
+#define __MONO_IO_PORTABILITY_H
 
 #include <mono/utils/mono-compiler.h>