mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Improved reuse of file descriptors for which close() is delayed to prevent
clearly of posix advisory locks. FossilOrigin-Name: 509c1ba26a4c12c63ecf04ddfa2f175eaf4dd9b96ab7be15faebd36deb0a0a31
This commit is contained in:
@@ -5770,6 +5770,7 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){
|
||||
UnixUnusedFd **pp;
|
||||
assert( sqlite3_mutex_notheld(pInode->pLockMutex) );
|
||||
sqlite3_mutex_enter(pInode->pLockMutex);
|
||||
flags &= (SQLITE_OPEN_READONLY|SQLITE_OPEN_READWRITE);
|
||||
for(pp=&pInode->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext));
|
||||
pUnused = *pp;
|
||||
if( pUnused ){
|
||||
@@ -6073,7 +6074,8 @@ static int unixOpen(
|
||||
|
||||
if( p->pPreallocatedUnused ){
|
||||
p->pPreallocatedUnused->fd = fd;
|
||||
p->pPreallocatedUnused->flags = flags;
|
||||
p->pPreallocatedUnused->flags =
|
||||
flags & (SQLITE_OPEN_READONLY|SQLITE_OPEN_READWRITE);
|
||||
}
|
||||
|
||||
if( isDelete ){
|
||||
|
||||
Reference in New Issue
Block a user