public interface IFileLock
Lifecycle: create() -> (acquire() -> release() ->)* discard
MT-safety: a mutex instance is safe for use by multiple concurrent threads.
| 限定符和类型 | 接口和说明 |
|---|---|
static class |
IFileLock.Factory |
static class |
IFileLock.FileLockException |
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
LOCK_ACQUIRED_ALREADY
[none]
|
static String |
LOCK_ACQUISITION_FAILURE
[none]
|
static String |
LOCK_ACQUISITION_SECURITY_FAILURE
[none]
|
static String |
LOCK_ACQUISITION_TIMEOUT
[none]
|
static final String LOCK_ACQUISITION_SECURITY_FAILURE
void acquire()
throws IFileLock.FileLockException,
InterruptedException
This method blocks until it either succeeds or errors out or the calling thread is interrupted.
IFileLock.FileLockException - if this lock has already been acquired.IFileLock.FileLockException - if the lock could not be acquired.InterruptedException - if the calling thread is interrupted.void release()
Copyright © 2018. All rights reserved.