001/*
002 *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003 *
004 *  This file is licensed to You under the Eclipse Public License (EPL);
005 *  You may not use this file except in compliance with the License. You
006 *  may obtain a copy of the License at
007 *
008 *      http://www.opensource.org/licenses/eclipse-1.0.php
009 *
010 *  See the COPYRIGHT.txt file distributed with this work for information
011 *  regarding copyright ownership.
012 */
013package org.vmmagic.pragma;
014
015import java.lang.annotation.Retention;
016import java.lang.annotation.Target;
017import java.lang.annotation.RetentionPolicy;
018import java.lang.annotation.ElementType;
019import org.vmmagic.Pragma;
020
021/**
022 * A pragma that can be used to declare that a particular method is logically
023 * uninterruptible even though it contains bytecodes that are actually
024 * interruptible.<p>
025 *
026 * The effect of this pragma is to suppress warning messages about violations of
027 * uninterruptiblity when compiling a method that throws this exception. There
028 * are two cases in which using the pragma is justified.
029 * <ul>
030 * <li> Uninterruptibility is ensured via some other mechanism. For example, the
031 * method explicitly disables threadswitching around the interruptible regions
032 * (VM.sysWrite on String). Or the interruptible regions are not reachable when
033 * the VM is running (various VM.sysWrite that check VM.runningVM).
034 * <li> The interruptible regions represent an 'error' condition that will never
035 * be executed unless the VM is already in the process of reporting an error,
036 * for example RuntimeEntrypoints.raiseClassCastException.
037 * </ul>
038 * Extreme care must be exercised when using this pragma since it suppresses the
039 * checking of uninterruptibility.
040 * <p>
041 * Use of this pragma is being phased out since it lumps together two possible
042 * special cases. Use either {@link Unpreemptible} or
043 * {@link UninterruptibleNoWarn} instead.
044 * See <a href="http://jira.codehaus.org/browse/RVM-115">RVM-115</a> for more
045 * context.
046 * @deprecated
047 */
048@Retention(RetentionPolicy.RUNTIME)
049@Target(ElementType.METHOD)
050@Pragma
051public @interface LogicallyUninterruptible { }