/ Check-in [cce1f521]
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 a locking error introduced when porting the new Apple locking code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA1: cce1f521362a87cc46fc5bfba68b7c188e2ea34f
User & Date: drh 2011-10-11 15:03:45
Context
2011-10-11
18:38
Simplify the readonly_shm implementation so that it conforms to the implementation on trunk. Update the test cases to agree with the new behavior. check-in: 9efb74ce user: drh tags: apple-osx
15:03
Fix a locking error introduced when porting the new Apple locking code. check-in: cce1f521 user: drh tags: apple-osx
14:19
Merge the latest trunk changes into the apple-osx branch. check-in: 7e2c4898 user: drh tags: apple-osx
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_unix.c.

1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606


1607




1608
1609
1610
1611
1612
1613
1614
      lock.l_len = SHARED_SIZE;
      lock.l_type = F_WRLCK;
      rc = osFcntl(pFile->h, F_SETLK, &lock);
      if( rc<0 ) return rc;
      pInode->bProcessLock = 1;
      pInode->nLock++;
    }else{
      int i = 0;                      
      do {
        rc = osFcntl(pFile->h, F_SETLK, pLock);
        if( rc && nRetry ){
           usleep(100 * (++i));
        }
      }while( !rc && nRetry-- );
      rc = 0;
    }
  }else{


    rc = osFcntl(pFile->h, F_SETLK, pLock);




  }
  return rc;
}

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







<
<
<
<
<
<
<



>
>
|
>
>
>
>







1590
1591
1592
1593
1594
1595
1596







1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
      lock.l_len = SHARED_SIZE;
      lock.l_type = F_WRLCK;
      rc = osFcntl(pFile->h, F_SETLK, &lock);
      if( rc<0 ) return rc;
      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: