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