/ Check-in [fcb7348b]
Login

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

Overview
Comment:Reinstate assert() statements in os_unix.c that were removed to allow wal-mode SHARED locks to be taken over more than one locking slot (this branch no longer does that, so the assert() statements can go back in).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | begin-concurrent-wal2
Files: files | file ages | folders
SHA3-256:fcb7348ba190e48112a681f704313a733f7a377456e7c1d6845ba34c270d86b6
User & Date: dan 2019-01-02 17:08:06
Wiki:begin-concurrent-wal2
Context
2019-01-11
14:59
Merge latest wal2 changes (documentation only) into this branch. check-in: 820ba1cc user: dan tags: begin-concurrent-wal2
2019-01-02
19:46
Merge changes from begin-concurrent-wal2. Also modify the unix-excl shm-locks on this branch so that it is not an error to attempt to release an EXCLUSIVE lock that is not held. check-in: 86685679 user: dan tags: begin-concurrent-pnu-wal2
17:08
Reinstate assert() statements in os_unix.c that were removed to allow wal-mode SHARED locks to be taken over more than one locking slot (this branch no longer does that, so the assert() statements can go back in). check-in: fcb7348b user: dan tags: begin-concurrent-wal2
17:00
Reinstate assert() statements in os_unix.c that were removed to allow wal-mode SHARED locks to be taken over more than one locking slot (this branch no longer does that, so the assert() statements can go back in). check-in: 8445fb6d user: dan tags: wal2
16:30
Merge latest wal2 changes into this branch. check-in: c31eeb3c user: dan tags: begin-concurrent-wal2
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  4309   4309   
  4310   4310     /* Access to the unixShmNode object is serialized by the caller */
  4311   4311     pShmNode = pFile->pInode->pShmNode;
  4312   4312     assert( pShmNode->nRef==0 || sqlite3_mutex_held(pShmNode->pShmMutex) );
  4313   4313     assert( pShmNode->nRef>0 || unixMutexHeld() );
  4314   4314   
  4315   4315     /* Shared locks never span more than one byte */
  4316         -  /* assert( n==1 || lockType!=F_RDLCK ); */
         4316  +  assert( n==1 || lockType!=F_RDLCK );
  4317   4317   
  4318   4318     /* Locks are within range */
  4319   4319     assert( n>=1 && n<=SQLITE_SHM_NLOCK );
  4320   4320   
  4321   4321     if( pShmNode->hShm>=0 ){
  4322   4322       /* Initialize the locking parameters */
  4323   4323       f.l_type = lockType;
................................................................................
  4812   4812     assert( pShmNode->pInode==pDbFd->pInode );
  4813   4813     assert( ofst>=0 && ofst+n<=SQLITE_SHM_NLOCK );
  4814   4814     assert( n>=1 );
  4815   4815     assert( flags==(SQLITE_SHM_LOCK | SQLITE_SHM_SHARED)
  4816   4816          || flags==(SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE)
  4817   4817          || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED)
  4818   4818          || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE) );
  4819         -  /* assert( n==1 || (flags & SQLITE_SHM_EXCLUSIVE)!=0 ); */
         4819  +  assert( n==1 || (flags & SQLITE_SHM_EXCLUSIVE)!=0 );
  4820   4820     assert( pShmNode->hShm>=0 || pDbFd->pInode->bProcessLock==1 );
  4821   4821     assert( pShmNode->hShm<0 || pDbFd->pInode->bProcessLock==0 );
  4822   4822   
  4823   4823     mask = (1<<(ofst+n)) - (1<<ofst);
  4824   4824     assert( n>1 || mask==(1<<ofst) );
  4825   4825     sqlite3_mutex_enter(pShmNode->pShmMutex);
  4826   4826     if( flags & SQLITE_SHM_UNLOCK ){