Method
getLock
(int ownerId, int resourceID)
Source from the content-addressed store, hash-verified
| 89 | /* Get the lock, verifying first that the process is really calling the locks in the order |
| 90 | * it said it would. */ |
| 91 | public Lock getLock(int ownerId, int resourceID) { |
| 92 | LinkedList<LockNode> list = lockOrder.get(ownerId); |
| 93 | if (list == null) { |
| 94 | return null; |
| 95 | } |
| 96 | |
| 97 | LockNode head = list.getFirst(); |
| 98 | if (head.getId() == resourceID) { |
| 99 | list.removeFirst(); |
| 100 | return head.getLock(); |
| 101 | } |
| 102 | return null; |
| 103 | } |
| 104 | } |
Tested by
no test coverage detected