@NotThreadSafe public interface InodeLockList extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the lock list, releasing all locks.
|
void |
downgradeLastEdge()
Downgrades the last edge lock in the lock list from WRITE lock to READ lock.
|
void |
downgradeToReadLocks()
Downgrades all locks in the current lock list to read locks.
|
boolean |
endsInInode() |
Inode |
get(int index) |
InodeLockManager |
getInodeLockManager() |
List<Inode> |
getLockedInodes() |
default List<InodeView> |
getLockedInodeViews() |
LockMode |
getLockMode() |
boolean |
isEmpty() |
void |
lockEdge(Inode inode,
String childName,
LockMode mode)
Locks an edge leading out of the last inode in the list.
|
void |
lockInode(Inode inode,
LockMode mode)
Locks the given inode and adds it to the lock list.
|
void |
lockRootEdge(LockMode mode)
Locks the root edge in the specified mode.
|
int |
numInodes() |
void |
pushWriteLockedEdge(Inode inode,
String childName)
Leapfrogs the final edge write lock forward, reducing the lock list's write-locked scope.
|
void |
unlockLastEdge()
Unlocks the last locked edge.
|
void |
unlockLastInode()
Unlocks the last locked inode.
|
void lockRootEdge(LockMode mode)
mode
- the mode to lock invoid lockInode(Inode inode, LockMode mode)
inode
- the inode to lockmode
- the mode to lock invoid lockEdge(Inode inode, String childName, LockMode mode)
inode
- the parent inode of the edgechildName
- the child name of the edgemode
- the mode to lock invoid unlockLastInode()
void unlockLastEdge()
void downgradeToReadLocks()
void downgradeLastEdge()
void pushWriteLockedEdge(Inode inode, String childName)
inode
- the inode to add to the lock listchildName
- the child name for the edge to add to the lock listLockMode getLockMode()
LockMode.WRITE
if the last entry in the list is write-locked, otherwise
LockMode.READ
default List<InodeView> getLockedInodeViews()
Inode get(int index)
index
- the index of the listint numInodes()
boolean endsInInode()
boolean isEmpty()
InodeLockManager getInodeLockManager()
void close()
close
in interface AutoCloseable
Copyright © 2023. All Rights Reserved.