1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Add ALWAYS() to conditionals associated with SHM locking that are always true.

FossilOrigin-Name: b599e89076d60afede7d2b3503b9338ca863d0c2d25799afe4080a6186386ea9
This commit is contained in:
drh
2020-11-06 16:48:55 +00:00
parent 4e451aad54
commit 78043e891a
3 changed files with 9 additions and 9 deletions

View File

@@ -4907,7 +4907,7 @@ static int unixShmLock(
if( rc==SQLITE_OK ){
memset(&aLock[ofst], 0, sizeof(int)*n);
}
}else if( p->sharedMask & (1<<ofst) ){
}else if( ALWAYS(p->sharedMask & (1<<ofst)) ){
assert( n==1 && aLock[ofst]>1 );
aLock[ofst]--;
}
@@ -4940,7 +4940,7 @@ static int unixShmLock(
int ii;
for(ii=ofst; ii<ofst+n; ii++){
assert( (p->sharedMask & mask)==0 );
if( (p->exclMask & (1<<ii))==0 && aLock[ii] ){
if( ALWAYS((p->exclMask & (1<<ii))==0) && aLock[ii] ){
rc = SQLITE_BUSY;
break;
}