1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Make sure xShmGet is never called while already holding the shared-memory

segment.

FossilOrigin-Name: 92ebdbc5f64ac63796ff56c1e1aec3b95c6bdd20
This commit is contained in:
drh
2010-05-13 09:11:31 +00:00
parent 043c20e63e
commit 5500a1f1e6
3 changed files with 11 additions and 10 deletions

View File

@@ -419,6 +419,7 @@ static void walIndexUnmap(Wal *pWal){
static int walIndexMap(Wal *pWal, int reqSize){
int rc = SQLITE_OK;
if( pWal->pWiData==0 || reqSize>pWal->szWIndex ){
walIndexUnmap(pWal);
rc = sqlite3OsShmGet(pWal->pDbFd, reqSize, &pWal->szWIndex,
(void**)(char*)&pWal->pWiData);
if( rc==SQLITE_OK && pWal->pWiData==0 ){