private static void pcache1EnforceMaxPage(PGroup pGroup) { Debug.Assert(MutexEx.Held(pGroup.mutex)); while (pGroup.nCurrentPage > pGroup.nMaxPage && pGroup.pLruTail != null) { PgHdr1 p = pGroup.pLruTail; Debug.Assert(p.pCache.pGroup == pGroup); pcache1PinPage(p); pcache1RemoveFromHash(p); pcache1FreePage(ref p); } }
public static void xDestroy(ref IPCache pCache) { PGroup pGroup = pCache.pGroup; Debug.Assert(pCache.bPurgeable || (pCache.nMax == 0 && pCache.nMin == 0)); pcache1EnterMutex(pGroup); pCache.pcache1TruncateUnsafe(0); pGroup.nMaxPage -= pCache.nMax; pGroup.nMinPage -= pCache.nMin; pGroup.mxPinned = pGroup.nMaxPage + 10 - pGroup.nMinPage; pcache1EnforceMaxPage(pGroup); pcache1LeaveMutex(pGroup); pCache = null; }
private static void pcache1LeaveMutex(PGroup X) { MutexEx.sqlite3_mutex_leave(X.mutex); }
private static void pcache1EnterMutex(PGroup X) { MutexEx.sqlite3_mutex_enter(X.mutex); }
private static void pcache1LeaveMutex(PGroup X) { MutexEx.Leave(X.mutex); }
private static void pcache1EnterMutex(PGroup X) { MutexEx.Enter(X.mutex); }