001 /*
002 * $Id: PreemptStatus.java 1249 2007-07-29 10:05:58Z kredel $
003 */
004
005 package edu.jas.kern;
006
007
008 /**
009 * PreemptStatus,
010 * defines global status for preemtive interruption handling.
011 * @author Heinz Kredel
012 */
013
014 public class PreemptStatus {
015
016 /**
017 * Global status flag.
018 */
019 private static boolean allowPreempt = true;
020
021
022 /**
023 * No public constructor.
024 */
025 protected PreemptStatus() {
026 }
027
028
029 /**
030 * isAllowed.
031 * @return true, preemtive interruption is allowed, else false.
032 */
033 public static boolean isAllowed() {
034 return allowPreempt;
035 }
036
037
038 /**
039 * setAllow,
040 * set preemtive interruption to allowed status.
041 */
042 public static void setAllow() {
043 allowPreempt = true;
044 }
045
046
047 /**
048 * setNotAllow,
049 * set preemtive interruption to not allowed status.
050 */
051 public static void setNotAllow() {
052 allowPreempt = false;
053 }
054
055 }