/ Check-in [5e304fed]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix mutex related bug in pcache.c to do with handling IO errors. (CVS 5632)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5e304fed275137f98be56f475504422d1f5113a4
User & Date: danielk1977 2008-08-28 11:12:09
Context
2008-08-28
13:15
Use ckfree() instead of sqlite3_free() to free an allocation made by ckalloc() in test_thread.c (test code only). (CVS 5633) check-in: 677ac144 user: danielk1977 tags: trunk
11:12
Fix mutex related bug in pcache.c to do with handling IO errors. (CVS 5632) check-in: 5e304fed user: danielk1977 tags: trunk
10:21
Enable the disabled asserts added by (5629). Add extra tests to thread003.test. And the required modifications to pcache.c. (CVS 5631) check-in: 473c09fa user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pcache.c.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file implements that page cache.
    13     13   **
    14         -** @(#) $Id: pcache.c,v 1.21 2008/08/28 10:21:17 danielk1977 Exp $
           14  +** @(#) $Id: pcache.c,v 1.22 2008/08/28 11:12:09 danielk1977 Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   
    18     18   /*
    19     19   ** A complete page cache is an instance of this structure.
    20     20   **
    21     21   ** A cache may only be deleted by its owner and while holding the
................................................................................
   568    568       if( !pPg ){
   569    569         for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pPrev);
   570    570       }
   571    571       if( pPg ){
   572    572         int rc;
   573    573         pcacheExitMutex();
   574    574         rc = pCache->xStress(pCache->pStress, pPg);
          575  +      pcacheEnterMutex();
   575    576         if( rc!=SQLITE_OK ){
   576    577           return rc;
   577    578         }
   578         -      pcacheEnterMutex();
   579    579       }
   580    580     }
   581    581   
   582    582     /* If the global page limit has been reached, try to recycle a page. */
   583    583     if( pCache->bPurgeable && pcache.nCurrentPage>=pcache.nMaxPage ){
   584    584       p = pcacheRecyclePage();
   585    585     }