Code example for Semaphore

0
     * @param size max to hold to at any given time. if < 0 then no limit 
     */ 
    public SimplePool(String name, int size){
        _name = name;
        _size = size;
        _sem = new Semaphore(size);
    } 
 
    /** Creates a new object of this pool's type.  Implementations should throw a runtime exception if unable to create. 
     * @return the new object. 
     */ 
    protected abstract T createNew(); 
 
    /** 
     * override this if you need to do any cleanup 
     */ 
    public void cleanup( T t ) {
    } 
 
    /**