< prev index next >
src/hotspot/share/runtime/serviceThread.cpp
Print this page
rev 50373 : 8195097: Make it possible to process StringTable outside safepoint
Reviewed-by:
*** 21,30 ****
--- 21,31 ----
* questions.
*
*/
#include "precompiled.hpp"
+ #include "classfile/stringTable.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/serviceThread.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/os.hpp"
*** 80,89 ****
--- 81,91 ----
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 stringtable_work = 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.
*** 96,116 ****
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())) {
// 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);
}
if (has_jvmti_events) {
jvmti_event = JvmtiDeferredEventQueue::dequeue();
}
}
if (has_jvmti_events) {
jvmti_event.post();
}
if (sensors_changed) {
--- 98,123 ----
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()) &&
! !(stringtable_work = StringTable::has_work())) {
// 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);
}
if (has_jvmti_events) {
jvmti_event = JvmtiDeferredEventQueue::dequeue();
}
}
+ if (stringtable_work) {
+ StringTable::do_concurrent_work(jt);
+ }
+
if (has_jvmti_events) {
jvmti_event.post();
}
if (sensors_changed) {
< prev index next >