I found the code and the comment at [unixLock] of os_unix.h is different.
The comment say that a shared lock will lock a random byte from ?shared byte 
range?(which is 510 bytes length). But the code show that it locks the whole 
?shared byte range?.
It makes me confused. Which one does the right thing?


The comment in os_unix.h
 ** To obtain a SHARED lock, a read-lock is obtained on the 'pending
 ** byte'. If this is successful, a random byte from the 'shared byte
 ** range' is read-locked and the lock on the 'pending byte' released.


The code in os_unix.h
  /* Now get the read-lock */
  lock.l_start = SHARED_FIRST;
  lock.l_len = SHARED_SIZE;
  if( unixFileLock(pFile, lock) ){
   tErrno = errno;
   rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK);
  }

Reply via email to