/ Check-in [600df309]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix the retry mechanism on file locks.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA1: 600df309fc547db3dc21cfc41609eb3dcaa67273
User & Date: drh 2015-08-11 18:18:24
Context
2015-08-28
02:12
Merge trunk enhancements into the apple-osx branch. Most tests works, but there are yet a few issues to be resolved. check-in: da864658 user: drh tags: apple-osx
2015-08-11
18:18
Fix the retry mechanism on file locks. check-in: 600df309 user: drh tags: apple-osx
2015-04-20
01:25
Merge all recent trunk enhancements and fixes into the apple-osx branch. check-in: 74b7bf17 user: drh tags: apple-osx
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

  1771   1771         pInode->bProcessLock = 1;
  1772   1772         pInode->nLock++;
  1773   1773       }else{
  1774   1774         rc = 0;
  1775   1775       }
  1776   1776     }else{
  1777   1777       int i = 0;                      
  1778         -    do {
         1778  +    for(;;){
  1779   1779         rc = osFcntl(pFile->h, F_SETLK, pLock);
  1780         -      if( rc && nRetry ){
  1781         -         usleep(100 * (++i));
         1780  +      if( rc && nRetry-- ){
         1781  +        usleep(100 * (++i));
         1782  +      }else{
         1783  +        break;
  1782   1784         }
  1783         -    }while( !rc && nRetry-- );
         1785  +    }
  1784   1786     }
  1785   1787     return rc;
  1786   1788   }
  1787   1789   
  1788   1790   /*
  1789   1791   ** Lock the file with the lock specified by parameter eFileLock - one
  1790   1792   ** of the following: