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 |