1 package DEOS; 20 21 import gov.nasa.jpf.jvm.Verify; 22 23 24 27 class DEOS { 28 static NewTimer theTimer; 30 static PeriodicClock thePeriodicClock; 31 static Clock systemClock; 32 static boolean abstraction = false; 33 static String indent = ""; 34 static String INC = " "; 35 36 public static void inc () { 38 } 40 41 public static void main (String [] args) { 42 Verify.beginAtomic(); 43 44 if (args.length == 1) { 46 if (args[0].equals("abstraction")) { 47 abstraction = true; 48 } 49 } 50 51 System.out.println("JAVA - DEOS\n"); 52 53 theTimer = new NewTimer(); 54 thePeriodicClock = new PeriodicClock(Registry.uSecsInFastestPeriod); 55 systemClock = new Clock(thePeriodicClock, theTimer); 56 57 DEOSKernel.coldStartKernel(); 58 59 int result = DEOSKernel.createThreadK("user1", 0, 21, 1); 60 61 62 result = DEOSKernel.createThreadK("user2", 0, 21, 1); 64 65 int tickResult = Clock.NOINTERRUPTS; 67 68 Verify.endAtomic(); 69 70 while (true) { 71 Verify.beginAtomic(); 72 73 74 DEOS.println("*************************"); 76 DEOS.println("Current time: " + DEOS.systemClock.getCurrentTime()); 77 78 DEOS.println(Scheduler.currentThread().toString() + 79 " is the current thread"); 80 81 tickResult = DEOS.systemClock.ticks(); 82 83 Scheduler.currentThread().getBody().run(tickResult); 84 85 Verify.endAtomic(); 86 } 87 } 88 89 public static void println (java.lang.String s) { 90 System.out.println(indent + s); 91 } 92 } | Popular Tags |