414 }
415 }
416 }
417
418 if (num_active == 0) {
419 return 0;
420 } else if (attempts > max_wait) {
421 return num_active;
422 } else if (num_active_compiler_thread == 0 && attempts > max_wait_user_thread) {
423 return num_active;
424 }
425
426 attempts++;
427
428 MonitorLocker ml(&timer, Mutex::_no_safepoint_check_flag);
429 ml.wait(10);
430 }
431 }
432
433 bool VM_Exit::doit_prologue() {
434 if (AsyncDeflateIdleMonitors && log_is_enabled(Info, monitorinflation)) {
435 // AsyncDeflateIdleMonitors does a special deflation in order
436 // to reduce the in-use monitor population that is reported by
437 // ObjectSynchronizer::log_in_use_monitor_details() at VM exit.
438 ObjectSynchronizer::request_deflate_idle_monitors();
439 }
440 return true;
441 }
442
443 void VM_Exit::doit() {
444
445 if (VerifyBeforeExit) {
446 HandleMark hm(VMThread::vm_thread());
447 // Among other things, this ensures that Eden top is correct.
448 Universe::heap()->prepare_for_verify();
449 // Silent verification so as not to pollute normal output,
450 // unless we really asked for it.
451 Universe::verify();
452 }
453
454 CompileBroker::set_should_block();
455
456 // Wait for a short period for threads in native to block. Any thread
457 // still executing native code after the wait will be stopped at
|
414 }
415 }
416 }
417
418 if (num_active == 0) {
419 return 0;
420 } else if (attempts > max_wait) {
421 return num_active;
422 } else if (num_active_compiler_thread == 0 && attempts > max_wait_user_thread) {
423 return num_active;
424 }
425
426 attempts++;
427
428 MonitorLocker ml(&timer, Mutex::_no_safepoint_check_flag);
429 ml.wait(10);
430 }
431 }
432
433 bool VM_Exit::doit_prologue() {
434 if (log_is_enabled(Info, monitorinflation)) {
435 // Do a deflation in order to reduce the in-use monitor population
436 // that is reported by ObjectSynchronizer::log_in_use_monitor_details()
437 // at VM exit.
438 ObjectSynchronizer::request_deflate_idle_monitors();
439 }
440 return true;
441 }
442
443 void VM_Exit::doit() {
444
445 if (VerifyBeforeExit) {
446 HandleMark hm(VMThread::vm_thread());
447 // Among other things, this ensures that Eden top is correct.
448 Universe::heap()->prepare_for_verify();
449 // Silent verification so as not to pollute normal output,
450 // unless we really asked for it.
451 Universe::verify();
452 }
453
454 CompileBroker::set_should_block();
455
456 // Wait for a short period for threads in native to block. Any thread
457 // still executing native code after the wait will be stopped at
|