Beispiel #1
0
 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);
     }
 }
 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);
     }
 }
Beispiel #3
0
        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;
        }
Beispiel #4
0
 private static void pcache1LeaveMutex(PGroup X)
 {
     MutexEx.sqlite3_mutex_leave(X.mutex);
 }
Beispiel #5
0
 private static void pcache1EnterMutex(PGroup X)
 {
     MutexEx.sqlite3_mutex_enter(X.mutex);
 }
Beispiel #6
0
 private static void pcache1LeaveMutex(PGroup X)
 {
     MutexEx.Leave(X.mutex);
 }
Beispiel #7
0
 private static void pcache1EnterMutex(PGroup X)
 {
     MutexEx.Enter(X.mutex);
 }
Beispiel #8
0
 private static void pcache1LeaveMutex(PGroup X)
 {
     MutexEx.sqlite3_mutex_leave(X.mutex);
 }
Beispiel #9
0
 private static void pcache1EnterMutex(PGroup X)
 {
     MutexEx.sqlite3_mutex_enter(X.mutex);
 }