胶多不粘话多不甜,直接上代码: 生产者类: /** * Created by 51304 on 2016/2/28. */ public class P { private String lock; public P(String lock){ this.lock = lock; } public void setValue(){ try{ synchronized (this.lock){ if(!ValueObject.value.equals("")){ lock.wait();…
package queue; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * Created by MyWorld on 2016/2/1. */ public class A…