add stop()
authorDavid Crawshaw <david@zentus.com>
Mon, 27 Nov 2006 09:53:14 +0000 (01:53 -0800)
committerDavid Crawshaw <david@zentus.com>
Mon, 27 Nov 2006 09:53:14 +0000 (01:53 -0800)
darcs-hash:20061127095314-0c629-438fa14add7a3699090678d68db8e8c594dab0e1.gz

src/org/ibex/nestedvm/Runtime.java

index 55851c3..44505c1 100644 (file)
@@ -596,7 +596,12 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable {
         
         _started();        
     }
-    
+
+    public final void stop() {
+        if (state != RUNNING && state != PAUSED) throw new IllegalStateException("stop() called in inappropriate state");
+        exit(0, false);
+    }
+
     /** Hook for subclasses to do their own startup */
     void _started() {  }