--- a/JavaVM.st Thu Mar 20 14:43:25 2014 +0000
+++ b/JavaVM.st Fri Mar 21 13:25:14 2014 +0000
@@ -1931,6 +1931,8 @@
initializeVM
+ | booter blocker |
+
OperatingSystem initResources.
Java initializeRelease.
@@ -1980,12 +1982,10 @@
"/ by resolver ... (sigh)
JavaNativeMethod flushAllCachedNativeMethods.
- JavaMethod
- allSubInstancesDo: [
- :m |
+ JavaMethod allSubInstancesDo: [ :m |
m checked: false.
m code: nil.
- ].
+ ].
ObjectMemory flushCaches.
"/ sigh - must flush inline caches.
@@ -2012,12 +2012,25 @@
self initializeReflection.
self initializeBaseClasses.
self initializePrimitiveClasses.
- Java initSystemClass.
- Java initializeCurrentThread.
- self initializeSystemClassLoader.
+
+ "/ Initialization spawns couple of new threads, namely
+ "/ finalization handler and signal handler. Those processes
+ "/ should form their own new process group.
+ blocker := Semaphore new.
+ booter := [
+ Java initSystemClass.
+ Java initializeCurrentThread.
+ self initializeSystemClassLoader.
+ FinalizationLobby startFinalizationProcessAt: 5.
+ blocker signal.
+ ] newProcess.
+ booter beGroupLeader.
+ booter resume.
+ blocker wait.
+
ObjectMemory addDependent: self.
StartupTime := OperatingSystem getOSTime.
- FinalizationLobby startFinalizationProcessAt: 5.
+
JavaNativeMethod allInstancesDo:[:e|e nCallsReset ].
@@ -2031,7 +2044,7 @@
"Modified: / 15-10-2010 / 15:27:45 / Jan Kurs <kurs.jan@post.cz>"
"Modified: / 24-02-2012 / 13:59:29 / Marcel Hlopko <hlopik@gmail.com>"
"Modified: / 24-02-2012 / 14:37:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
- "Modified: / 09-12-2013 / 23:22:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 21-03-2014 / 12:38:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
initializeVMIfNoEventThreadRunning