/ Check-in [3d8b298d]
Login

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

Overview
Comment:Add a mutex around an sqlite3StatusAdd() call to prevent the pagecount overflow measurements from getting off in multithreaded applications.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3d8b298dc24fe13a3f390da41f79b8613a6f25a7
User & Date: drh 2011-01-26 13:24:40
Context
2011-01-26
13:28
More mutexes around another sqlite3StatusAdd() call. check-in: e3b500fb user: drh tags: trunk
13:24
Add a mutex around an sqlite3StatusAdd() call to prevent the pagecount overflow measurements from getting off in multithreaded applications. check-in: 3d8b298d user: drh tags: trunk
07:25
Update mutex1.test so that it works with the memsubsys1 permutation (pagecache memory). Change a few instances of SQLITE_MUTEX_STATIC_LRU2 in comments and test code to STATIC_PMEM. check-in: 456bd5c6 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/pcache1.c.

   224    224     if( p==0 ){
   225    225       /* Memory is not available in the SQLITE_CONFIG_PAGECACHE pool.  Get
   226    226       ** it from sqlite3Malloc instead.
   227    227       */
   228    228       p = sqlite3Malloc(nByte);
   229    229       if( p ){
   230    230         int sz = sqlite3MallocSize(p);
          231  +      sqlite3_mutex_enter(pcache1.mutex);
   231    232         sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, sz);
          233  +      sqlite3_mutex_leave(pcache1.mutex);
   232    234       }
   233    235       sqlite3MemdebugSetType(p, MEMTYPE_PCACHE);
   234    236     }
   235    237     return p;
   236    238   }
   237    239   
   238    240   /*