SQLite

Check-in [e3b500fb5d]
Login

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

Overview
Comment:More mutexes around another sqlite3StatusAdd() call.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e3b500fb5d93d98e6e1ddf6d494a841274d1b68d
User & Date: drh 2011-01-26 13:28:06.817
References
2011-01-26
15:23
Update test file mutex1.test to account for [e3b500fb5d]. (check-in: c86e46f4fd user: dan tags: trunk)
Context
2011-01-26
15:23
Update test file mutex1.test to account for [e3b500fb5d]. (check-in: c86e46f4fd user: dan tags: trunk)
13:28
More mutexes around another sqlite3StatusAdd() call. (check-in: e3b500fb5d 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: 3d8b298dc2 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pcache1.c.
254
255
256
257
258
259
260

261

262
263
264
265
266
267
268
    assert( pcache1.nFreeSlot<=pcache1.nSlot );
    sqlite3_mutex_leave(pcache1.mutex);
  }else{
    int iSize;
    assert( sqlite3MemdebugHasType(p, MEMTYPE_PCACHE) );
    sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
    iSize = sqlite3MallocSize(p);

    sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -iSize);

    sqlite3_free(p);
  }
}

#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
/*
** Return the size of a pcache allocation







>

>







254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
    assert( pcache1.nFreeSlot<=pcache1.nSlot );
    sqlite3_mutex_leave(pcache1.mutex);
  }else{
    int iSize;
    assert( sqlite3MemdebugHasType(p, MEMTYPE_PCACHE) );
    sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
    iSize = sqlite3MallocSize(p);
    sqlite3_mutex_enter(pcache1.mutex);
    sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -iSize);
    sqlite3_mutex_leave(pcache1.mutex);
    sqlite3_free(p);
  }
}

#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
/*
** Return the size of a pcache allocation