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