@Beta public final class InversibleLock extends Object
StampedLock
. In case a read is contented with a write, the read side will throw
an InversibleLockException
, which the caller can catch and use to wait for the write to resolve.Constructor and Description |
---|
InversibleLock() |
Modifier and Type | Method and Description |
---|---|
long |
optimisticRead()
Return a stamp for read validation.
|
void |
unlockWrite(long stamp) |
boolean |
validate(long stamp) |
long |
writeLock() |
public long optimisticRead()
validate(long)
.InversibleLockException
- if this lock is currently write-lockedpublic boolean validate(long stamp)
public long writeLock()
public void unlockWrite(long stamp)
Copyright © 2019 OpenDaylight. All rights reserved.