public class NonBlockingWriterLock extends ReadWriteLockWithUpgrade
Note that the write lock is exclusive among write locks, e.g., only one write lock can be granted at one time, but the write lock is independent of the read locks. For example, a read lock to be acquired will be blocked if there is existing write lock, but will not be blocked if there are mutiple read locks already granted to other owners. On the other hand, a write lock can be acquired as long as there is no existing write lock, regardless how many read locks have been granted.
ReadWriteLockWithUpgrade.ReaderLock, ReadWriteLockWithUpgrade.WriterLock
activeWriter_, dummy_, log_, readerLock_, upgraderLocal_, writerLock_
Constructor and Description |
---|
NonBlockingWriterLock() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
startWrite() |
allowReader, cancelledWaitingReader, cancelledWaitingWriter, changeLock, endRead, endWrite, readLock, startRead, startReadFromNewReader, startReadFromWaitingReader, startWriteFromNewWriter, startWriteFromWaitingWriter, toString, upgradeLockAttempt, writeLock
protected boolean startWrite()
startWrite
in class ReadWriteLockWithUpgrade
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.