comparison src/share/vm/utilities/accessFlags.cpp @ 20804:7848fc12602b

Merge with jdk8u40-b25
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Tue, 07 Apr 2015 14:58:49 +0200
parents 52b4284cb496 b12a2a9b05ca
children
comparison
equal deleted inserted replaced
20184:84105dcdb05b 20804:7848fc12602b
60 new_flags = old_flags & ~bits; 60 new_flags = old_flags & ~bits;
61 f = Atomic::cmpxchg(new_flags, &_flags, old_flags); 61 f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
62 } while(f != old_flags); 62 } while(f != old_flags);
63 } 63 }
64 64
65 // Returns true iff this thread succeeded setting the bit.
66 bool AccessFlags::atomic_set_one_bit(jint bit) {
67 // Atomically update the flags with the bit given
68 jint old_flags, new_flags, f;
69 bool is_setting_bit = false;
70 do {
71 old_flags = _flags;
72 new_flags = old_flags | bit;
73 is_setting_bit = old_flags != new_flags;
74 f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
75 } while(f != old_flags);
76
77 return is_setting_bit;
78 }
79
65 #if !defined(PRODUCT) || INCLUDE_JVMTI 80 #if !defined(PRODUCT) || INCLUDE_JVMTI
66 81
67 void AccessFlags::print_on(outputStream* st) const { 82 void AccessFlags::print_on(outputStream* st) const {
68 if (is_public ()) st->print("public " ); 83 if (is_public ()) st->print("public " );
69 if (is_private ()) st->print("private " ); 84 if (is_private ()) st->print("private " );