/ Check-in [600df309]
Login

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 Unified Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781


1782
1783

1784
1785
1786
1787
1788
1789
1790
      pInode->bProcessLock = 1;
      pInode->nLock++;
    }else{
      rc = 0;
    }
  }else{
    int i = 0;                      
    do {
      rc = osFcntl(pFile->h, F_SETLK, pLock);
      if( rc && nRetry ){
         usleep(100 * (++i));


      }
    }while( !rc && nRetry-- );

  }
  return rc;
}

/*
** Lock the file with the lock specified by parameter eFileLock - one
** of the following:







|

|
|
>
>

<
>







1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784

1785
1786
1787
1788
1789
1790
1791
1792
      pInode->bProcessLock = 1;
      pInode->nLock++;
    }else{
      rc = 0;
    }
  }else{
    int i = 0;                      
    for(;;){
      rc = osFcntl(pFile->h, F_SETLK, pLock);
      if( rc && nRetry-- ){
        usleep(100 * (++i));
      }else{
        break;
      }

    }
  }
  return rc;
}

/*
** Lock the file with the lock specified by parameter eFileLock - one
** of the following: