public interface NonBlockingSemaphore
| Modifier and Type | Interface and Description |
|---|---|
static interface |
NonBlockingSemaphore.Factory
Abstract factory for creating concrete instances of classes implementing
NonBlockingSemaphore. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquire()
Acquires a resource if available.
|
boolean |
acquire(int resources)
Acquires the specified number of resources if they all are available.
|
boolean |
release()
Releases a resource returning it to this semaphore.
|
boolean |
release(int resources)
Releases the specified number of resources returning it to this semaphore.
|
boolean acquire()
An invocation of this method yields exactly the same result as acquire(1)
true if the resource has been acquired; false otherwise.boolean acquire(int resources)
true if all the requested resources have been acquired; false otherwise.boolean release()
An invocation of this method yields exactly the same result as release(1)
true if the resource has been released; false otherwise.boolean release(int resources)
true if all the requested resources have been released; false otherwise.Copyright © 2018. All rights reserved.