nachos.kernel.threads.test
Class AlarmTest

java.lang.Object
  extended by nachos.kernel.devices.InterruptHandler
      extended by nachos.kernel.threads.test.AlarmTest
All Implemented Interfaces:
nachos.machine.InterruptHandler

public class AlarmTest
extends InterruptHandler

This class demonstrates the use of timers. Some timers are created, then they are cancelled. If there is something else using the CPU, then the timers might go off before being cancelled.


Field Summary
private static nachos.machine.Timer t1
          Timer instances created for the test.
private static nachos.machine.Timer t2
          Timer instances created for the test.
private static nachos.machine.Timer t3
          Timer instances created for the test.
private  int which
          Integer that identifies which instance this is.
 
Constructor Summary
AlarmTest(int w)
          Initialize a handler for a timer instance.
 
Method Summary
 void serviceDevice()
          Interrupt service routine called when the timer expires.
static void start(java.lang.String[] args)
          Entry point for the test.
 
Methods inherited from class nachos.kernel.devices.InterruptHandler
handleInterrupt, yieldOnReturn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

t1

private static nachos.machine.Timer t1
Timer instances created for the test.


t2

private static nachos.machine.Timer t2
Timer instances created for the test.


t3

private static nachos.machine.Timer t3
Timer instances created for the test.


which

private int which
Integer that identifies which instance this is.

Constructor Detail

AlarmTest

public AlarmTest(int w)
Initialize a handler for a timer instance.

Parameters:
w - Integer that identifies the instance.
Method Detail

start

public static void start(java.lang.String[] args)
Entry point for the test.

Parameters:
args - Command-line arguments -- currently ignored.

serviceDevice

public void serviceDevice()
Interrupt service routine called when the timer expires.

Specified by:
serviceDevice in class InterruptHandler