3360 }
3361 // Someday we could have a table or list of all non-JavaThreads.
3362 // For now, just manually iterate through them.
3363 tc->do_thread(VMThread::vm_thread());
3364 Universe::heap()->gc_threads_do(tc);
3365 WatcherThread *wt = WatcherThread::watcher_thread();
3366 // Strictly speaking, the following NULL check isn't sufficient to make sure
3367 // the data for WatcherThread is still valid upon being examined. However,
3368 // considering that WatchThread terminates when the VM is on the way to
3369 // exit at safepoint, the chance of the above is extremely small. The right
3370 // way to prevent termination of WatcherThread would be to acquire
3371 // Terminator_lock, but we can't do that without violating the lock rank
3372 // checking in some cases.
3373 if (wt != NULL) {
3374 tc->do_thread(wt);
3375 }
3376
3377 // If CompilerThreads ever become non-JavaThreads, add them here
3378 }
3379
3380 // The system initialization in the library has three phases.
3381 //
3382 // Phase 1: java.lang.System class initialization
3383 // java.lang.System is a primordial class loaded and initialized
3384 // by the VM early during startup. java.lang.System.<clinit>
3385 // only does registerNatives and keeps the rest of the class
3386 // initialization work later until thread initialization completes.
3387 //
3388 // System.initPhase1 initializes the system properties, the static
3389 // fields in, out, and err. Set up java signal handlers, OS-specific
3390 // system settings, and thread group of the main thread.
3391 static void call_initPhase1(TRAPS) {
3392 Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
3393 JavaValue result(T_VOID);
3394 JavaCalls::call_static(&result, klass, vmSymbols::initPhase1_name(),
3395 vmSymbols::void_method_signature(), CHECK);
3396 }
3397
3398 // Phase 2. Module system initialization
3399 // This will initialize the module system. Only java.base classes
|
3360 }
3361 // Someday we could have a table or list of all non-JavaThreads.
3362 // For now, just manually iterate through them.
3363 tc->do_thread(VMThread::vm_thread());
3364 Universe::heap()->gc_threads_do(tc);
3365 WatcherThread *wt = WatcherThread::watcher_thread();
3366 // Strictly speaking, the following NULL check isn't sufficient to make sure
3367 // the data for WatcherThread is still valid upon being examined. However,
3368 // considering that WatchThread terminates when the VM is on the way to
3369 // exit at safepoint, the chance of the above is extremely small. The right
3370 // way to prevent termination of WatcherThread would be to acquire
3371 // Terminator_lock, but we can't do that without violating the lock rank
3372 // checking in some cases.
3373 if (wt != NULL) {
3374 tc->do_thread(wt);
3375 }
3376
3377 // If CompilerThreads ever become non-JavaThreads, add them here
3378 }
3379
3380 void Threads::parallel_java_threads_do(ThreadClosure* tc) {
3381 int cp = Threads::thread_claim_parity();
3382 ALL_JAVA_THREADS(p) {
3383 if (p->claim_oops_do(true, cp)) {
3384 tc->do_thread(p);
3385 }
3386 }
3387 }
3388
3389 // The system initialization in the library has three phases.
3390 //
3391 // Phase 1: java.lang.System class initialization
3392 // java.lang.System is a primordial class loaded and initialized
3393 // by the VM early during startup. java.lang.System.<clinit>
3394 // only does registerNatives and keeps the rest of the class
3395 // initialization work later until thread initialization completes.
3396 //
3397 // System.initPhase1 initializes the system properties, the static
3398 // fields in, out, and err. Set up java signal handlers, OS-specific
3399 // system settings, and thread group of the main thread.
3400 static void call_initPhase1(TRAPS) {
3401 Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
3402 JavaValue result(T_VOID);
3403 JavaCalls::call_static(&result, klass, vmSymbols::initPhase1_name(),
3404 vmSymbols::void_method_signature(), CHECK);
3405 }
3406
3407 // Phase 2. Module system initialization
3408 // This will initialize the module system. Only java.base classes
|