jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
changeset 45518 4a116dd82fb5
parent 44359 c6761862ca0b
child 45635 56b0672b0070
equal deleted inserted replaced
45440:d952dcd38dba 45518:4a116dd82fb5
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   870      */
   870      */
   871     @ForceInline
   871     @ForceInline
   872     public final boolean compareAndSwapObject(Object o, long offset,
   872     public final boolean compareAndSwapObject(Object o, long offset,
   873                                               Object expected,
   873                                               Object expected,
   874                                               Object x) {
   874                                               Object x) {
   875         return theInternalUnsafe.compareAndSwapObject(o, offset, expected, x);
   875         return theInternalUnsafe.compareAndSetObject(o, offset, expected, x);
   876     }
   876     }
   877 
   877 
   878     /**
   878     /**
   879      * Atomically updates Java variable to {@code x} if it is currently
   879      * Atomically updates Java variable to {@code x} if it is currently
   880      * holding {@code expected}.
   880      * holding {@code expected}.
   886      */
   886      */
   887     @ForceInline
   887     @ForceInline
   888     public final boolean compareAndSwapInt(Object o, long offset,
   888     public final boolean compareAndSwapInt(Object o, long offset,
   889                                            int expected,
   889                                            int expected,
   890                                            int x) {
   890                                            int x) {
   891         return theInternalUnsafe.compareAndSwapInt(o, offset, expected, x);
   891         return theInternalUnsafe.compareAndSetInt(o, offset, expected, x);
   892     }
   892     }
   893 
   893 
   894     /**
   894     /**
   895      * Atomically updates Java variable to {@code x} if it is currently
   895      * Atomically updates Java variable to {@code x} if it is currently
   896      * holding {@code expected}.
   896      * holding {@code expected}.
   902      */
   902      */
   903     @ForceInline
   903     @ForceInline
   904     public final boolean compareAndSwapLong(Object o, long offset,
   904     public final boolean compareAndSwapLong(Object o, long offset,
   905                                             long expected,
   905                                             long expected,
   906                                             long x) {
   906                                             long x) {
   907         return theInternalUnsafe.compareAndSwapLong(o, offset, expected, x);
   907         return theInternalUnsafe.compareAndSetLong(o, offset, expected, x);
   908     }
   908     }
   909 
   909 
   910     /**
   910     /**
   911      * Fetches a reference value from a given Java variable, with volatile
   911      * Fetches a reference value from a given Java variable, with volatile
   912      * load semantics. Otherwise identical to {@link #getObject(Object, long)}
   912      * load semantics. Otherwise identical to {@link #getObject(Object, long)}