/** * Atomically transitions the node to the <tt>dead</tt> state and decrements the * <tt>weightedSize</tt>. * * @param node the entry in the page replacement policy */ @GuardedBy("evictionLock") void makeDead(Node<K, V> node) { synchronized (node) { if (node.isDead()) { return; } if (evicts()) { // The node's policy weight may be out of sync due to a pending update waiting to be // processed. At this point the node's weight is finalized, so the weight can be safely // taken from the node's perspective and the sizes will be adjusted correctly. if (node.inEden()) { lazySetEdenWeightedSize(edenWeightedSize() - node.getWeight()); } else if (node.inMainProtected()) { lazySetMainProtectedWeightedSize(mainProtectedWeightedSize() - node.getWeight()); } lazySetWeightedSize(weightedSize() - node.getWeight()); } node.die(); } }
/** * Atomically transitions the node to the <tt>dead</tt> state and decrements the * <tt>weightedSize</tt>. * * @param node the entry in the page replacement policy */ @GuardedBy("evictionLock") void makeDead(Node<K, V> node) { synchronized (node) { if (node.isDead()) { return; } if (evicts()) { // The node's policy weight may be out of sync due to a pending update waiting to be // processed. At this point the node's weight is finalized, so the weight can be safely // taken from the node's perspective and the sizes will be adjusted correctly. if (node.inEden()) { lazySetEdenWeightedSize(edenWeightedSize() - node.getWeight()); } else if (node.inMainProtected()) { lazySetMainProtectedWeightedSize(mainProtectedWeightedSize() - node.getWeight()); } lazySetWeightedSize(weightedSize() - node.getWeight()); } node.die(); } }