equal
deleted
inserted
replaced
85 RuntimeHistogramElement::RuntimeHistogramElement(const char* elementName) { |
85 RuntimeHistogramElement::RuntimeHistogramElement(const char* elementName) { |
86 static volatile int RuntimeHistogram_lock = 0; |
86 static volatile int RuntimeHistogram_lock = 0; |
87 _name = elementName; |
87 _name = elementName; |
88 uintx count = 0; |
88 uintx count = 0; |
89 |
89 |
90 while (Atomic::cmpxchg(1, &RuntimeHistogram_lock, 0) != 0) { |
90 while (Atomic::cmpxchg(&RuntimeHistogram_lock, 0, 1) != 0) { |
91 while (Atomic::load_acquire(&RuntimeHistogram_lock) != 0) { |
91 while (Atomic::load_acquire(&RuntimeHistogram_lock) != 0) { |
92 count +=1; |
92 count +=1; |
93 if ( (WarnOnStalledSpinLock > 0) |
93 if ( (WarnOnStalledSpinLock > 0) |
94 && (count % WarnOnStalledSpinLock == 0)) { |
94 && (count % WarnOnStalledSpinLock == 0)) { |
95 warning("RuntimeHistogram_lock seems to be stalled"); |
95 warning("RuntimeHistogram_lock seems to be stalled"); |