зеркало из https://github.com/mono/ikvm-fork.git
More bootstrap issues.
This commit is contained in:
Родитель
1ba38da0a4
Коммит
1aebb753ea
|
@ -164,6 +164,7 @@ public final class Startup
|
|||
{
|
||||
}
|
||||
}
|
||||
java.lang.Thread.currentThread();
|
||||
}
|
||||
|
||||
public static void exitMainThread()
|
||||
|
|
|
@ -39,6 +39,7 @@ using SystemThreadingThreadPriority = System.Threading.ThreadPriority;
|
|||
using IKVM.Internal;
|
||||
#if !FIRST_PASS
|
||||
using jlClass = java.lang.Class;
|
||||
using jlClassLoader = java.lang.ClassLoader;
|
||||
using jlArrayIndexOutOfBoundsException = java.lang.ArrayIndexOutOfBoundsException;
|
||||
using jlClassNotFoundException = java.lang.ClassNotFoundException;
|
||||
using jlIllegalAccessException = java.lang.IllegalAccessException;
|
||||
|
@ -1334,6 +1335,7 @@ namespace IKVM.NativeCode.java
|
|||
|
||||
public static void registerNatives()
|
||||
{
|
||||
Thread.Bootstrap();
|
||||
}
|
||||
|
||||
public static object defineClass0(object thisClassLoader, string name, byte[] b, int off, int len, object pd)
|
||||
|
@ -2157,11 +2159,16 @@ namespace IKVM.NativeCode.java
|
|||
|
||||
jlThreadGroup systemThreadGroup = (jlThreadGroup)Activator.CreateInstance(typeof(jlThreadGroup), true);
|
||||
mainThreadGroup = new jlThreadGroup(systemThreadGroup, "main");
|
||||
// the first thread here is the main thread
|
||||
AttachThread("main", false, null);
|
||||
AttachThread(null, false, null);
|
||||
typeof(jlSystem).GetMethod("initializeSystemClass", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null);
|
||||
// make sure the Launcher singleton is created on the main thread and allow it to install the security manager
|
||||
smLauncher.getLauncher();
|
||||
if (jlClassLoader.getSystemClassLoader() == null)
|
||||
{
|
||||
// HACK because of bootstrap issues (Launcher instantiates a URL and GNU Classpath's URL calls getSystemClassLoader) we have
|
||||
// to set clear the sclSet flag here, to make sure the system class loader is constructed next time getSystemClassLoader is called
|
||||
typeof(jlClassLoader).GetField("sclSet", BindingFlags.Static | BindingFlags.NonPublic).SetValue(null, false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
internal static void Bootstrap()
|
||||
|
|
Загрузка…
Ссылка в новой задаче