/ Check-in [e3b500fb]
Login

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

Overview
Comment:More mutexes around another sqlite3StatusAdd() call.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e3b500fb5d93d98e6e1ddf6d494a841274d1b68d
User & Date: drh 2011-01-26 13:28:06
References
2011-01-26
15:23
Update test file mutex1.test to account for [e3b500fb5d]. check-in: c86e46f4 user: dan tags: trunk
Context
2011-01-26
15:23
Update test file mutex1.test to account for [e3b500fb5d]. check-in: c86e46f4 user: dan tags: trunk
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
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pcache1.c.

   254    254       assert( pcache1.nFreeSlot<=pcache1.nSlot );
   255    255       sqlite3_mutex_leave(pcache1.mutex);
   256    256     }else{
   257    257       int iSize;
   258    258       assert( sqlite3MemdebugHasType(p, MEMTYPE_PCACHE) );
   259    259       sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
   260    260       iSize = sqlite3MallocSize(p);
          261  +    sqlite3_mutex_enter(pcache1.mutex);
   261    262       sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -iSize);
          263  +    sqlite3_mutex_leave(pcache1.mutex);
   262    264       sqlite3_free(p);
   263    265     }
   264    266   }
   265    267   
   266    268   #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
   267    269   /*
   268    270   ** Return the size of a pcache allocation