< prev index next >

src/hotspot/share/gc/shared/gcLocker.cpp

Print this page
rev 47287 : Port 09.17.Thread_SMR_logging_update from JDK9 to JDK10
rev 47289 : eosterlund, stefank CR - refactor code into threadSMR.cpp and threadSMR.hpp
rev 47292 : stefank, coleenp CR - refactor most JavaThreadIterator usage to use JavaThreadIteratorWithHandle.

*** 44,63 **** void GCLocker::verify_critical_count() { if (SafepointSynchronize::is_at_safepoint()) { assert(!needs_gc() || _debug_jni_lock_count == _jni_lock_count, "must agree"); int count = 0; // Count the number of threads with critical operations in progress ! ThreadsListHandle tlh; ! JavaThreadIterator jti(tlh.list()); ! for (JavaThread* thr = jti.first(); thr != NULL; thr = jti.next()) { if (thr->in_critical()) { count++; } } if (_jni_lock_count != count) { log_error(gc, verify)("critical counts don't match: %d != %d", _jni_lock_count, count); ! for (JavaThread* thr = jti.first(); thr != NULL; thr = jti.next()) { if (thr->in_critical()) { log_error(gc, verify)(INTPTR_FORMAT " in_critical %d", p2i(thr), thr->in_critical()); } } } --- 44,63 ---- void GCLocker::verify_critical_count() { if (SafepointSynchronize::is_at_safepoint()) { assert(!needs_gc() || _debug_jni_lock_count == _jni_lock_count, "must agree"); int count = 0; // Count the number of threads with critical operations in progress ! JavaThreadIteratorWithHandle jtiwh; ! for (; JavaThread *thr = jtiwh.next(); ) { if (thr->in_critical()) { count++; } } if (_jni_lock_count != count) { log_error(gc, verify)("critical counts don't match: %d != %d", _jni_lock_count, count); ! jtiwh.rewind(); ! for (; JavaThread *thr = jtiwh.next(); ) { if (thr->in_critical()) { log_error(gc, verify)(INTPTR_FORMAT " in_critical %d", p2i(thr), thr->in_critical()); } } }
< prev index next >