protected class WriterPreferenceReadWriteLock.ReaderLock extends WriterPreferenceReadWriteLock.Signaller implements Sync
ONE_CENTURY, ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ONE_YEAR| 限定符 | 构造器和说明 |
|---|---|
protected |
ReaderLock() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
acquire()
Wait (possibly forever) until successful passage.
|
boolean |
attempt(long msecs)
Wait at most msecs to pass; report whether passed.
|
void |
release()
Potentially enable others to pass.
|
public void acquire()
throws InterruptedException
Syncacquire 在接口中 SyncInterruptedExceptionpublic void release()
Syncpublic boolean attempt(long msecs)
throws InterruptedException
Syncattempt 在接口中 Syncmsecs - the number of milleseconds to wait.
An argument less than or equal to zero means not to wait at all.
However, this may still require
access to a synchronization lock, which can impose unbounded
delay if there is a lot of contention among threads.InterruptedExceptionCopyright © 2024. All rights reserved.