src/hotspot/share/runtime/serviceThread.cpp
changeset 51405 8b23aa7cef47
parent 50445 bd6b78feb6a3
child 51472 eb97d1a319f9
equal deleted inserted replaced
51404:c5461fe16efb 51405:8b23aa7cef47
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "classfile/stringTable.hpp"
    26 #include "classfile/stringTable.hpp"
       
    27 #include "classfile/symbolTable.hpp"
    27 #include "runtime/interfaceSupport.inline.hpp"
    28 #include "runtime/interfaceSupport.inline.hpp"
    28 #include "runtime/javaCalls.hpp"
    29 #include "runtime/javaCalls.hpp"
    29 #include "runtime/serviceThread.hpp"
    30 #include "runtime/serviceThread.hpp"
    30 #include "runtime/mutexLocker.hpp"
    31 #include "runtime/mutexLocker.hpp"
    31 #include "runtime/os.hpp"
    32 #include "runtime/os.hpp"
    82     bool has_jvmti_events = false;
    83     bool has_jvmti_events = false;
    83     bool has_gc_notification_event = false;
    84     bool has_gc_notification_event = false;
    84     bool has_dcmd_notification_event = false;
    85     bool has_dcmd_notification_event = false;
    85     bool acs_notify = false;
    86     bool acs_notify = false;
    86     bool stringtable_work = false;
    87     bool stringtable_work = false;
       
    88     bool symboltable_work = false;
    87     JvmtiDeferredEvent jvmti_event;
    89     JvmtiDeferredEvent jvmti_event;
    88     {
    90     {
    89       // Need state transition ThreadBlockInVM so that this thread
    91       // Need state transition ThreadBlockInVM so that this thread
    90       // will be handled by safepoint correctly when this thread is
    92       // will be handled by safepoint correctly when this thread is
    91       // notified at a safepoint.
    93       // notified at a safepoint.
    99       MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
   101       MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
   100       while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) &&
   102       while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) &&
   101              !(has_jvmti_events = JvmtiDeferredEventQueue::has_events()) &&
   103              !(has_jvmti_events = JvmtiDeferredEventQueue::has_events()) &&
   102               !(has_gc_notification_event = GCNotifier::has_event()) &&
   104               !(has_gc_notification_event = GCNotifier::has_event()) &&
   103               !(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification()) &&
   105               !(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification()) &&
   104               !(stringtable_work = StringTable::has_work())) {
   106               !(stringtable_work = StringTable::has_work()) &&
       
   107               !(symboltable_work = SymbolTable::has_work())) {
   105         // wait until one of the sensors has pending requests, or there is a
   108         // wait until one of the sensors has pending requests, or there is a
   106         // pending JVMTI event or JMX GC notification to post
   109         // pending JVMTI event or JMX GC notification to post
   107         Service_lock->wait(Mutex::_no_safepoint_check_flag);
   110         Service_lock->wait(Mutex::_no_safepoint_check_flag);
   108       }
   111       }
   109 
   112 
   112       }
   115       }
   113     }
   116     }
   114 
   117 
   115     if (stringtable_work) {
   118     if (stringtable_work) {
   116       StringTable::do_concurrent_work(jt);
   119       StringTable::do_concurrent_work(jt);
       
   120     }
       
   121 
       
   122     if (symboltable_work) {
       
   123       SymbolTable::do_concurrent_work(jt);
   117     }
   124     }
   118 
   125 
   119     if (has_jvmti_events) {
   126     if (has_jvmti_events) {
   120       jvmti_event.post();
   127       jvmti_event.post();
   121     }
   128     }