Package com.compomics.util.threading
Class SimpleSemaphore
java.lang.Object
com.compomics.util.threading.SimpleSemaphore
public class SimpleSemaphore extends Object
A simple semaphore where thread interrupted exception are thrown as runtime exception.
- Author:
- Marc Vaudel
-
Constructor Summary
Constructors Constructor Description SimpleSemaphore(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