< prev index next >

src/share/vm/runtime/serviceThread.cpp

Print this page
rev 13054 : imported patch monitor_deflate_conc

@@ -87,10 +87,11 @@
     bool sensors_changed = false;
     bool has_jvmti_events = false;
     bool has_gc_notification_event = false;
     bool has_dcmd_notification_event = false;
     bool acs_notify = false;
+    bool deflate_idle_monitors = false;
     JvmtiDeferredEvent jvmti_event;
     {
       // Need state transition ThreadBlockInVM so that this thread
       // will be handled by safepoint correctly when this thread is
       // notified at a safepoint.

@@ -104,11 +105,12 @@
       MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
       while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) &&
              !(has_jvmti_events = JvmtiDeferredEventQueue::has_events()) &&
               !(has_gc_notification_event = GCNotifier::has_event()) &&
               !(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification()) &&
-             !(acs_notify = AllocationContextService::should_notify())) {
+             !(acs_notify = AllocationContextService::should_notify()) &&
+             !(deflate_idle_monitors = ObjectSynchronizer::should_deflate_idle_monitors_conc())) {
         // wait until one of the sensors has pending requests, or there is a
         // pending JVMTI event or JMX GC notification to post
         Service_lock->wait(Mutex::_no_safepoint_check_flag);
       }
 

@@ -134,10 +136,14 @@
     }
 
     if (acs_notify) {
       AllocationContextService::notify(CHECK);
     }
+
+    if (deflate_idle_monitors) {
+      ObjectSynchronizer::deflate_idle_monitors_conc();
+    }
   }
 }
 
 bool ServiceThread::is_service_thread(Thread* thread) {
   return thread == _instance;
< prev index next >