public interface Semaphores extends TaskComponent, ServerComponent
Modifier and Type | Interface and Description |
---|---|
static class |
Semaphores.Semaphore |
Modifier and Type | Method and Description |
---|---|
Semaphores.Semaphore |
acquire(String name)
Try to acquire a semaphore.
|
Semaphores.Semaphore |
acquire(String name,
int maxAgeInSeconds,
int updatePeriodInSeconds)
Try to acquire a semaphore for a given duration.
|
void |
release(String name)
Release the lock on a semaphore by its name.
|
Semaphores.Semaphore acquire(String name, int maxAgeInSeconds, int updatePeriodInSeconds)
name
- the key of the semaphoremaxAgeInSeconds
- the max duration in seconds the semaphore will be considered unlocked if
it was not updated. The value zero forces the semaphore to be acquired, whatever its status.updatePeriodInSeconds
- the period in seconds the semaphore will be updated.Semaphores.Semaphore acquire(String name)
name
- the key of the semaphoreCopyright © 2009–2015 SonarSource. All rights reserved.