/ Check-in [fe441df9]
Login

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

Overview
Comment:Work around restriction in Windows file locking.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fe441df9ba447d97571e919099846efa3ec87427
User & Date: shaneh 2010-12-07 17:12:21
Context
2010-12-07
20:14
Version 3.7.4 check-in: a586a4de user: drh tags: trunk, release, version-3.7.4
17:12
Work around restriction in Windows file locking. check-in: fe441df9 user: shaneh tags: trunk
16:39
Fix a bug in the demo "superlock" code preventing locks from being released in some circumstances. check-in: 65c39379 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

configure became a regular file.


install-sh became a regular file.


Changes to src/test_superlock.c.

   147    147   ** Release a superlock held on a database file. The argument passed to 
   148    148   ** this function must have been obtained from a successful call to
   149    149   ** sqlite3demo_superlock().
   150    150   */
   151    151   void sqlite3demo_superunlock(void *pLock){
   152    152     Superlock *p = (Superlock *)pLock;
   153    153     if( p->bWal ){
          154  +    int rc;                         /* Return code */
   154    155       int flags = SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE;
   155    156       sqlite3_file *fd = 0;
   156         -    sqlite3_file_control(p->db, "main", SQLITE_FCNTL_FILE_POINTER, (void *)&fd);
   157         -    fd->pMethods->xShmLock(fd, 2, SQLITE_SHM_NLOCK-2, flags);
          157  +    rc = sqlite3_file_control(p->db, "main", SQLITE_FCNTL_FILE_POINTER, (void *)&fd);
          158  +    if( rc==SQLITE_OK ){
          159  +      fd->pMethods->xShmLock(fd, 2, 1, flags);
          160  +      fd->pMethods->xShmLock(fd, 3, SQLITE_SHM_NLOCK-3, flags);
          161  +    }
   158    162     }
   159    163     sqlite3_close(p->db);
   160    164     sqlite3_free(p);
   161    165   }
   162    166   
   163    167   /*
   164    168   ** Obtain a superlock on the database file identified by zPath, using the