📄 gestorpooling.java
字号:
/* * GestorPooling.java * * Created on 14 de abril de 2005, 15:48 */package org.mikel.jchord.red;import java.util.*;/** * * @author mikel */public class GestorPooling { private Vector colaEjecutables; /** Creates a new instance of GestorPoolThreads */ public GestorPooling(int tama駉) { colaEjecutables = new Vector(1,10); for(int i=0; i<tama駉; i++){ new EjecutorParaPool(this); } } synchronized void esperarEjecucion (EjecutorParaPool ejecutor) throws InterruptedException{ while(colaEjecutables.size()==0) wait(); Runnable e = (Runnable) colaEjecutables.elementAt(0); colaEjecutables.removeElementAt(0); ejecutor.ejecutar(e); } synchronized void a馻dir(Runnable r){ colaEjecutables.addElement(r); notify(); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -