< prev index next >
src/hotspot/share/runtime/interfaceSupport.cpp
Print this page
@@ -85,11 +85,11 @@
RuntimeHistogramElement::RuntimeHistogramElement(const char* elementName) {
static volatile int RuntimeHistogram_lock = 0;
_name = elementName;
uintx count = 0;
- while (Atomic::cmpxchg(1, &RuntimeHistogram_lock, 0) != 0) {
+ while (Atomic::cmpxchg(&RuntimeHistogram_lock, 0, 1) != 0) {
while (Atomic::load_acquire(&RuntimeHistogram_lock) != 0) {
count +=1;
if ( (WarnOnStalledSpinLock > 0)
&& (count % WarnOnStalledSpinLock == 0)) {
warning("RuntimeHistogram_lock seems to be stalled");
< prev index next >