1 25 package org.objectweb.easybeans.tests.common.resources; 26 27 32 public class Semaphore extends java.util.concurrent.Semaphore { 33 34 37 private static final long serialVersionUID = -3414920460785733832L; 38 41 private int maxValue; 42 43 44 48 public Semaphore(final int initialValue) { 49 super(initialValue); 50 maxValue = initialValue; 51 } 52 53 57 public synchronized void waitAll() { 58 while (maxValue != super.availablePermits()) { 59 try { 60 wait(); 61 } catch (InterruptedException e) { 62 e.printStackTrace(); 63 } 64 } 65 } 66 } 67 | Popular Tags |