src/share/vm/utilities/accessFlags.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7089790_full Sdiff src/share/vm/utilities

src/share/vm/utilities/accessFlags.cpp

Print this page
rev 2694 : imported patch headers_only


  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "oops/oop.inline.hpp"
  27 #include "utilities/accessFlags.hpp"
  28 #ifdef TARGET_OS_FAMILY_linux
  29 # include "os_linux.inline.hpp"
  30 #endif
  31 #ifdef TARGET_OS_FAMILY_solaris
  32 # include "os_solaris.inline.hpp"
  33 #endif
  34 #ifdef TARGET_OS_FAMILY_windows
  35 # include "os_windows.inline.hpp"
  36 #endif



  37 
  38 
  39 void AccessFlags::atomic_set_bits(jint bits) {
  40   // Atomically update the flags with the bits given
  41   jint old_flags, new_flags, f;
  42   do {
  43     old_flags = _flags;
  44     new_flags = old_flags | bits;
  45     f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
  46   } while(f != old_flags);
  47 }
  48 
  49 void AccessFlags::atomic_clear_bits(jint bits) {
  50   // Atomically update the flags with the bits given
  51   jint old_flags, new_flags, f;
  52   do {
  53     old_flags = _flags;
  54     new_flags = old_flags & ~bits;
  55     f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
  56   } while(f != old_flags);




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "oops/oop.inline.hpp"
  27 #include "utilities/accessFlags.hpp"
  28 #ifdef TARGET_OS_FAMILY_linux
  29 # include "os_linux.inline.hpp"
  30 #endif
  31 #ifdef TARGET_OS_FAMILY_solaris
  32 # include "os_solaris.inline.hpp"
  33 #endif
  34 #ifdef TARGET_OS_FAMILY_windows
  35 # include "os_windows.inline.hpp"
  36 #endif
  37 #ifdef TARGET_OS_FAMILY_bsd
  38 # include "os_bsd.inline.hpp"
  39 #endif
  40 
  41 
  42 void AccessFlags::atomic_set_bits(jint bits) {
  43   // Atomically update the flags with the bits given
  44   jint old_flags, new_flags, f;
  45   do {
  46     old_flags = _flags;
  47     new_flags = old_flags | bits;
  48     f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
  49   } while(f != old_flags);
  50 }
  51 
  52 void AccessFlags::atomic_clear_bits(jint bits) {
  53   // Atomically update the flags with the bits given
  54   jint old_flags, new_flags, f;
  55   do {
  56     old_flags = _flags;
  57     new_flags = old_flags & ~bits;
  58     f = Atomic::cmpxchg(new_flags, &_flags, old_flags);
  59   } while(f != old_flags);


src/share/vm/utilities/accessFlags.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File