Package com.compomics.util.threading
Class SimpleSemaphore
java.lang.Object
com.compomics.util.threading.SimpleSemaphore
A simple semaphore where thread interrupted exception are thrown as runtime exception.
- Author:
- Marc Vaudel
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleSemaphore(int nPermits) Constructor.SimpleSemaphore(int nPermits, boolean fair) Constructor. -
Method Summary
-
Constructor Details
-
SimpleSemaphore
public SimpleSemaphore(int nPermits, boolean fair) Constructor.- Parameters:
nPermits- the number of permitsfair- boolean indicating whether threads should be processed in a fair way
-
SimpleSemaphore
public SimpleSemaphore(int nPermits) Constructor.- Parameters:
nPermits- the number of permits
-
-
Method Details
-
acquire
public void acquire()Acquires. -
release
public void release()Releases.
-