try (ResourceLock ignore = lock.obtain()) {
// do something while holding the resource lock
}
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public ResourceLock |
| ResourceLock | back to summary |
|---|---|
| public ResourceLock() | |
| close | back to summary |
|---|---|
| public void close() Implements java. Unlock on exit of try-with-resources block.
| |
| obtain | back to summary |
|---|---|
| public ResourceLock obtain() Obtain a lock and return the ResourceLock for use in try-with-resources block. | |