KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > util > concurrent > Semaphore

java.util.concurrent
Class Semaphore

java.lang.Object
  extended by java.util.concurrent.Semaphore
All Implemented Interfaces:
Serializable
See Also:
Top Examples, release, acquire, tryAcquire, Lock, release(), acquire()

public void acquire()
             throws InterruptedException
See Also:
Thread.interrupt(), release()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void acquire(int permits)
             throws InterruptedException
See Also:
Thread.interrupt(), IllegalArgumentException, release()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void acquireUninterruptibly()
See Also:
interrupted, release()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void acquireUninterruptibly(int permits)
See Also:
IllegalArgumentException, interrupted, release
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int availablePermits()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int drainPermits()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected Collection<Thread> getQueuedThreads()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public final int getQueueLength()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public final boolean hasQueuedThreads()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean isFair()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected void reducePermits(int reduction)
See Also:
IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void release()
See Also:
acquire()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void release(int permits)
See Also:
IllegalArgumentException, acquire
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Semaphore(int permits)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Semaphore(int permits,
                 boolean fair)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String toString()
See Also:
Object
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean tryAcquire()
See Also:
tryAcquire(0, TimeUnit.SECONDS)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean tryAcquire(int permits)
See Also:
IllegalArgumentException, tryAcquire(permits, 0, TimeUnit.SECONDS)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean tryAcquire(int permits,
                          long timeout,
                          TimeUnit unit)
                   throws InterruptedException
See Also:
Thread.interrupt(), IllegalArgumentException, release()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean tryAcquire(long timeout,
                          TimeUnit unit)
                   throws InterruptedException
See Also:
Thread.interrupt(), release()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags