acquireExclusive(); try { Node next = oldNode.mNextDirty; releaseExclusive();
/** * Caller must hold commit lock and exclusive latch on node. This method * should only be called for nodes whose existing data is not needed. */ void redirty(Node node) throws IOException { /*P*/ // [| /*P*/ // if (mFullyMapped) { /*P*/ // mPageDb.dirtyPage(node.mId); /*P*/ // } /*P*/ // ] mDirtyList.add(node, mCommitState); }
/** * Remove the old node from the dirty list and swap in the new node. Caller must hold * commit lock and latched the old node. The cached state of the nodes is not altered. */ void swapIfDirty(Node oldNode, Node newNode) { mDirtyList.swapIfDirty(oldNode, newNode); }
mDirtyList.flush(mPageDb, stateToFlush);
mDirtyList.delete(this);
mDirtyList.flush(mPageDb, stateToFlush);
mDirtyList.delete(this);
acquireExclusive(); try { Node next = oldNode.mNextDirty; releaseExclusive();
/** * Caller must hold commit lock and exclusive latch on node. This method * should only be called for nodes whose existing data is not needed. */ void redirty(Node node) throws IOException { /*P*/ // [| /*P*/ // if (mFullyMapped) { /*P*/ // mPageDb.dirtyPage(node.mId); /*P*/ // } /*P*/ // ] mDirtyList.add(node, mCommitState); }
/** * Remove the old node from the dirty list and swap in the new node. Caller must hold * commit lock and latched the old node. The cached state of the nodes is not altered. */ void swapIfDirty(Node oldNode, Node newNode) { mDirtyList.swapIfDirty(oldNode, newNode); }
acquireExclusive(); try { node.mCachedState = cachedState; releaseExclusive();
/** * Caller must hold commit lock and exclusive latch on node. */ private void dirty(Node node, long newId) throws IOException { /*P*/ // [| /*P*/ // if (mFullyMapped) { /*P*/ // if (node.mPage == p_nonTreePage()) { /*P*/ // node.mPage = mPageDb.dirtyPage(newId); /*P*/ // node.asEmptyRoot(); /*P*/ // } else if (node.mPage != p_closedTreePage()) { /*P*/ // node.mPage = mPageDb.copyPage(node.mId, newId); // copy on write /*P*/ // } /*P*/ // } /*P*/ // ] node.mId = newId; mDirtyList.add(node, mCommitState); }
acquireExclusive(); try { node.mCachedState = cachedState; releaseExclusive();
/** * Caller must hold commit lock and exclusive latch on node. */ private void dirty(Node node, long newId) throws IOException { /*P*/ // [| /*P*/ // if (mFullyMapped) { /*P*/ // if (node.mPage == p_nonTreePage()) { /*P*/ // node.mPage = mPageDb.dirtyPage(newId); /*P*/ // node.asEmptyRoot(); /*P*/ // } else if (node.mPage != p_closedTreePage()) { /*P*/ // node.mPage = mPageDb.copyPage(node.mId, newId); // copy on write /*P*/ // } /*P*/ // } /*P*/ // ] node.mId = newId; mDirtyList.add(node, mCommitState); }
/** * Remove and delete nodes from dirty list, as part of close sequence. */ void delete(LocalDatabase db) { acquireExclusive(); try { Node node = mFirstDirty; mFlushNext = null; mFirstDirty = null; mLastDirty = null; while (node != null) { node.delete(db); Node next = node.mNextDirty; node.mPrevDirty = null; node.mNextDirty = null; node = next; } } finally { releaseExclusive(); } } }
/** * Returns a new or recycled Node instance, latched exclusively, marked * dirty and unevictable. Caller must hold commit lock. * * @param mode MODE_UNEVICTABLE if allocated node cannot be automatically evicted */ Node allocDirtyNode(int mode) throws IOException { Node node = mPageDb.allocLatchedNode(this, mode); /*P*/ // [| /*P*/ // if (mFullyMapped) { /*P*/ // node.mPage = mPageDb.dirtyPage(node.mId); /*P*/ // } /*P*/ // ] mDirtyList.add(node, mCommitState); return node; }
/** * Remove and delete nodes from dirty list, as part of close sequence. */ void delete(LocalDatabase db) { acquireExclusive(); try { Node node = mFirstDirty; mFlushNext = null; mFirstDirty = null; mLastDirty = null; while (node != null) { node.delete(db); Node next = node.mNextDirty; node.mPrevDirty = null; node.mNextDirty = null; node = next; } } finally { releaseExclusive(); } } }
/** * Returns a new or recycled Node instance, latched exclusively, marked * dirty and unevictable. Caller must hold commit lock. * * @param mode MODE_UNEVICTABLE if allocated node cannot be automatically evicted */ Node allocDirtyNode(int mode) throws IOException { Node node = mPageDb.allocLatchedNode(this, mode); /*P*/ // [| /*P*/ // if (mFullyMapped) { /*P*/ // node.mPage = mPageDb.dirtyPage(node.mId); /*P*/ // } /*P*/ // ] mDirtyList.add(node, mCommitState); return node; }
acquireExclusive(); mFlushNext = mFirstDirty; releaseExclusive(); while (true) { int state; acquireExclusive(); try { node = mFlushNext; mFlushNext = node.mNextDirty; } finally { releaseExclusive(); acquireExclusive(); try { Node next = node.mNextDirty; releaseExclusive();
acquireExclusive(); mFlushNext = mFirstDirty; releaseExclusive(); while (true) { int state; acquireExclusive(); try { node = mFlushNext; mFlushNext = node.mNextDirty; } finally { releaseExclusive(); acquireExclusive(); try { Node next = node.mNextDirty; releaseExclusive();