?? scheduler2.java
字號:
import java.util.Vector;
abstract public class Scheduler2 extends Thread {
protected Vector processList ;
public Scheduler2() {
processList = new Vector() ;
}
public void addProcess(SimProc2 t) {
synchronized(this) { processList.addElement(t) ;}
synchronized(t) {
try { t.wait() ; }
catch (Exception e) {
System.out.println("Unexpected in addProcess " + e) ;
}
}
}
public void endSlice(SimProc2 t) {
synchronized(t) {
synchronized(this) { notify() ; }
try { t.wait() ;}
catch (Exception e) {
System.out.println("Unexpected in endSlice " + e) ;
}
}
}
public synchronized void removeProcess(SimProc2 t) {
processList.remove(t) ;
notify() ;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -