src/hotspot/share/utilities/accessFlags.cpp
changeset 59252 623722a6aeb9
parent 47216 71c04702a3d5
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
    31   // Atomically update the flags with the bits given
    31   // Atomically update the flags with the bits given
    32   jint old_flags, new_flags, f;
    32   jint old_flags, new_flags, f;
    33   do {
    33   do {
    34     old_flags = _flags;
    34     old_flags = _flags;
    35     new_flags = old_flags | bits;
    35     new_flags = old_flags | bits;
    36     f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
    36     f = Atomic::cmpxchg(&_flags, old_flags, new_flags);
    37   } while(f != old_flags);
    37   } while(f != old_flags);
    38 }
    38 }
    39 
    39 
    40 void AccessFlags::atomic_clear_bits(jint bits) {
    40 void AccessFlags::atomic_clear_bits(jint bits) {
    41   // Atomically update the flags with the bits given
    41   // Atomically update the flags with the bits given
    42   jint old_flags, new_flags, f;
    42   jint old_flags, new_flags, f;
    43   do {
    43   do {
    44     old_flags = _flags;
    44     old_flags = _flags;
    45     new_flags = old_flags & ~bits;
    45     new_flags = old_flags & ~bits;
    46     f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
    46     f = Atomic::cmpxchg(&_flags, old_flags, new_flags);
    47   } while(f != old_flags);
    47   } while(f != old_flags);
    48 }
    48 }
    49 
    49 
    50 
    50 
    51 #if !defined(PRODUCT) || INCLUDE_JVMTI
    51 #if !defined(PRODUCT) || INCLUDE_JVMTI