|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnachos.threads.Alarm
public class Alarm
Uses the hardware timer to provide preemption, and to allow threads to sleep until a certain time.
| Constructor Summary | |
|---|---|
Alarm()
Allocate a new Alarm. |
|
| Method Summary | |
|---|---|
void |
timerInterrupt()
The timer interrupt handler. |
void |
waitUntil(long x)
Put the current thread to sleep for at least x ticks, waking it up in the timer interrupt handler. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Alarm()
Note: Nachos will not function correctly with more than one alarm.
| Method Detail |
|---|
public void timerInterrupt()
public void waitUntil(long x)
(current time) >= (WaitUntil called time)+(x)
x - the minimum number of clock ticks to wait.Timer.getTime()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||