src/hotspot/share/runtime/interfaceSupport.cpp
changeset 59252 623722a6aeb9
parent 59247 56bf71d64d51
child 59290 97d13893ec3c
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
    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");