Code example for Semaphore

Methods: tryAcquire

0
		s.acquire();
		s.release();
	} 
 
	public boolean isComplete() throws InterruptedException { 
		return s.tryAcquire(10, TimeUnit.MILLISECONDS);
	} 
 
	public V getValue() throws Exception { 
		s.acquire();
		s.release();
		if (exception != null)
			throw exception;
		return value;
	} 
 
	public Progress getProgress() { 
		return progress;
	} 
}