rt/emul/compact/src/main/java/java/util/concurrent/Unsafe.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Sat, 19 Mar 2016 13:15:11 +0100
changeset 1896 9984d9a62bc0
permissions -rw-r--r--
Making java.util.concurrent compilable without references to sun.misc.Unsafe and co.
     1 /*
     2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  *
     4  * This code is free software; you can redistribute it and/or modify it
     5  * under the terms of the GNU General Public License version 2 only, as
     6  * published by the Free Software Foundation.  Oracle designates this
     7  * particular file as subject to the "Classpath" exception as provided
     8  * by Oracle in the LICENSE file that accompanied this code.
     9  *
    10  * This code is distributed in the hope that it will be useful, but WITHOUT
    11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    13  * version 2 for more details (a copy is included in the LICENSE file that
    14  * accompanied this code).
    15  *
    16  * You should have received a copy of the GNU General Public License version
    17  * 2 along with this work; if not, write to the Free Software Foundation,
    18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    19  *
    20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    21  * or visit www.oracle.com if you need additional information or have any
    22  * questions.
    23  */
    24 package java.util.concurrent;
    25 
    26 import java.lang.reflect.Field;
    27 
    28 final class Unsafe {
    29     static Unsafe getUnsafe() {
    30         throw new SecurityException();
    31     }
    32 
    33     void throwException(Throwable exception) {
    34         throw new SecurityException();
    35     }
    36 
    37     void putOrderedObject(Object q, long u, ForkJoinTask<?> t) {
    38         throw new SecurityException();
    39     }
    40 
    41     boolean compareAndSwapObject(Object q, long l, Object t, Object object) {
    42         throw new SecurityException();
    43     }
    44 
    45     Object getObjectVolatile(Object oldQ, long u) {
    46         throw new SecurityException();
    47     }
    48 
    49     void putObjectVolatile(Object q, long l, Object t) {
    50         throw new SecurityException();
    51     }
    52 
    53     long arrayBaseOffset(Class a) {
    54         throw new SecurityException();
    55     }
    56 
    57     int arrayIndexScale(Class a) {
    58         throw new SecurityException();
    59     }
    60 
    61     boolean compareAndSwapLong(Object aThis, long ctlOffset, long c, long nc) {
    62         throw new SecurityException();
    63     }
    64 
    65     void unpark(ForkJoinWorkerThread w) {
    66         throw new SecurityException();
    67     }
    68 
    69     boolean compareAndSwapInt(Object aThis, long blockedCountOffset, int b, int i) {
    70         throw new SecurityException();
    71     }
    72 
    73     long objectFieldOffset(Field declaredField) {
    74         throw new SecurityException();
    75     }
    76 
    77 }