0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This file is available under and governed by the GNU General Public 0N/A * License version 2 only, as published by the Free Software Foundation. 0N/A * However, the following notice accompanied the original version of this 0N/A * Written by Doug Lea with assistance from members of JCP JSR-166 0N/A * Expert Group and released to the public domain, as explained at 0N/A * A reflection-based utility that enables atomic updates to 0N/A * designated {@code volatile int} fields of designated classes. 0N/A * This class is designed for use in atomic data structures in which 0N/A * several fields of the same node are independently subject to atomic 0N/A * <p>Note that the guarantees of the {@code compareAndSet} 0N/A * method in this class are weaker than in other atomic classes. 0N/A * Because this class cannot ensure that all uses of the field 0N/A * are appropriate for purposes of atomic access, it can 0N/A * guarantee atomicity only with respect to other invocations of 0N/A * {@code compareAndSet} and {@code set} on the same updater. 0N/A * @param <T> The type of the object holding the updatable field 0N/A * Creates and returns an updater for objects with the given field. 0N/A * The Class argument is needed to check that reflective types and 0N/A * generic types match. 0N/A * @param tclass the class of the objects holding the field 0N/A * @param fieldName the name of the field to be updated 0N/A * @return the updater 0N/A * @throws IllegalArgumentException if the field is not a 0N/A * volatile integer type 0N/A * @throws RuntimeException with a nested reflection-based 0N/A * exception if the class does not hold field or is the wrong type 0N/A * Protected do-nothing constructor for use by subclasses. 0N/A * Atomically sets the field of the given object managed by this updater 0N/A * to the given updated value if the current value {@code ==} the 0N/A * expected value. This method is guaranteed to be atomic with respect to 0N/A * other calls to {@code compareAndSet} and {@code set}, but not 0N/A * necessarily with respect to other changes in the field. 0N/A * @param obj An object whose field to conditionally set 0N/A * @param expect the expected value 0N/A * @param update the new value 0N/A * @return true if successful 0N/A * @throws ClassCastException if {@code obj} is not an instance 0N/A * of the class possessing the field established in the constructor 0N/A * Atomically sets the field of the given object managed by this updater 0N/A * to the given updated value if the current value {@code ==} the 0N/A * expected value. This method is guaranteed to be atomic with respect to 0N/A * other calls to {@code compareAndSet} and {@code set}, but not 0N/A * necessarily with respect to other changes in the field. 0N/A * and does not provide ordering guarantees, so is only rarely an 0N/A * appropriate alternative to {@code compareAndSet}. 0N/A * @param obj An object whose field to conditionally set 0N/A * @param expect the expected value 0N/A * @param update the new value 0N/A * @return true if successful 0N/A * @throws ClassCastException if {@code obj} is not an instance 0N/A * of the class possessing the field established in the constructor 0N/A * Sets the field of the given object managed by this updater to the 0N/A * given updated value. This operation is guaranteed to act as a volatile 0N/A * store with respect to subsequent invocations of {@code compareAndSet}. 0N/A * @param obj An object whose field to set 0N/A * @param newValue the new value 0N/A * Eventually sets the field of the given object managed by this 0N/A * updater to the given updated value. 0N/A * @param obj An object whose field to set 0N/A * @param newValue the new value 0N/A * Gets the current value held in the field of the given object managed 0N/A * @param obj An object whose field to get 0N/A * @return the current value 0N/A * Atomically sets the field of the given object managed by this updater 0N/A * to the given value and returns the old value. 0N/A * @param obj An object whose field to get and set 0N/A * @param newValue the new value 0N/A * @return the previous value 0N/A * Atomically increments by one the current value of the field of the 0N/A * given object managed by this updater. 0N/A * @param obj An object whose field to get and set 0N/A * @return the previous value 0N/A * Atomically decrements by one the current value of the field of the 0N/A * given object managed by this updater. 0N/A * @param obj An object whose field to get and set 0N/A * @return the previous value 0N/A * Atomically adds the given value to the current value of the field of 0N/A * the given object managed by this updater. 0N/A * @param obj An object whose field to get and set 0N/A * @param delta the value to add 0N/A * @return the previous value 0N/A * Atomically increments by one the current value of the field of the 0N/A * given object managed by this updater. 0N/A * @param obj An object whose field to get and set 0N/A * @return the updated value 0N/A * Atomically decrements by one the current value of the field of the 0N/A * given object managed by this updater. 0N/A * @param obj An object whose field to get and set 0N/A * @return the updated value 0N/A * Atomically adds the given value to the current value of the field of 0N/A * the given object managed by this updater. 0N/A * @param obj An object whose field to get and set 0N/A * @param delta the value to add 0N/A * @return the updated value 0N/A * Standard hotspot implementation using intrinsics 0N/A " can not access a protected member of class " +
0N/A " using an instance of " +