Commit f40792a9 authored by Robert Haas's avatar Robert Haas

Use LOCKBIT_ON() instead of a bit shift in a few places.

We do this mostly everywhere, so it seems just as well to do it here,
too.

Thomas Munro
parent 45e5b4ef
...@@ -608,7 +608,7 @@ FindLockCycleRecurse(PGPROC *checkProc, ...@@ -608,7 +608,7 @@ FindLockCycleRecurse(PGPROC *checkProc,
break; break;
/* Is there a conflict with this guy's request? */ /* Is there a conflict with this guy's request? */
if (((1 << proc->waitLockMode) & conflictMask) != 0) if ((LOCKBIT_ON(proc->waitLockMode) & conflictMask) != 0)
{ {
/* This proc soft-blocks checkProc */ /* This proc soft-blocks checkProc */
if (FindLockCycleRecurse(proc, depth + 1, if (FindLockCycleRecurse(proc, depth + 1,
...@@ -648,7 +648,7 @@ FindLockCycleRecurse(PGPROC *checkProc, ...@@ -648,7 +648,7 @@ FindLockCycleRecurse(PGPROC *checkProc,
break; break;
/* Is there a conflict with this guy's request? */ /* Is there a conflict with this guy's request? */
if (((1 << proc->waitLockMode) & conflictMask) != 0) if ((LOCKBIT_ON(proc->waitLockMode) & conflictMask) != 0)
{ {
/* This proc soft-blocks checkProc */ /* This proc soft-blocks checkProc */
if (FindLockCycleRecurse(proc, depth + 1, if (FindLockCycleRecurse(proc, depth + 1,
......
...@@ -64,41 +64,41 @@ static const LOCKMASK LockConflicts[] = { ...@@ -64,41 +64,41 @@ static const LOCKMASK LockConflicts[] = {
0, 0,
/* AccessShareLock */ /* AccessShareLock */
(1 << AccessExclusiveLock), LOCKBIT_ON(AccessExclusiveLock),
/* RowShareLock */ /* RowShareLock */
(1 << ExclusiveLock) | (1 << AccessExclusiveLock), LOCKBIT_ON(ExclusiveLock) | LOCKBIT_ON(AccessExclusiveLock),
/* RowExclusiveLock */ /* RowExclusiveLock */
(1 << ShareLock) | (1 << ShareRowExclusiveLock) | LOCKBIT_ON(ShareLock) | LOCKBIT_ON(ShareRowExclusiveLock) |
(1 << ExclusiveLock) | (1 << AccessExclusiveLock), LOCKBIT_ON(ExclusiveLock) | LOCKBIT_ON(AccessExclusiveLock),
/* ShareUpdateExclusiveLock */ /* ShareUpdateExclusiveLock */
(1 << ShareUpdateExclusiveLock) | LOCKBIT_ON(ShareUpdateExclusiveLock) |
(1 << ShareLock) | (1 << ShareRowExclusiveLock) | LOCKBIT_ON(ShareLock) | LOCKBIT_ON(ShareRowExclusiveLock) |
(1 << ExclusiveLock) | (1 << AccessExclusiveLock), LOCKBIT_ON(ExclusiveLock) | LOCKBIT_ON(AccessExclusiveLock),
/* ShareLock */ /* ShareLock */
(1 << RowExclusiveLock) | (1 << ShareUpdateExclusiveLock) | LOCKBIT_ON(RowExclusiveLock) | LOCKBIT_ON(ShareUpdateExclusiveLock) |
(1 << ShareRowExclusiveLock) | LOCKBIT_ON(ShareRowExclusiveLock) |
(1 << ExclusiveLock) | (1 << AccessExclusiveLock), LOCKBIT_ON(ExclusiveLock) | LOCKBIT_ON(AccessExclusiveLock),
/* ShareRowExclusiveLock */ /* ShareRowExclusiveLock */
(1 << RowExclusiveLock) | (1 << ShareUpdateExclusiveLock) | LOCKBIT_ON(RowExclusiveLock) | LOCKBIT_ON(ShareUpdateExclusiveLock) |
(1 << ShareLock) | (1 << ShareRowExclusiveLock) | LOCKBIT_ON(ShareLock) | LOCKBIT_ON(ShareRowExclusiveLock) |
(1 << ExclusiveLock) | (1 << AccessExclusiveLock), LOCKBIT_ON(ExclusiveLock) | LOCKBIT_ON(AccessExclusiveLock),
/* ExclusiveLock */ /* ExclusiveLock */
(1 << RowShareLock) | LOCKBIT_ON(RowShareLock) |
(1 << RowExclusiveLock) | (1 << ShareUpdateExclusiveLock) | LOCKBIT_ON(RowExclusiveLock) | LOCKBIT_ON(ShareUpdateExclusiveLock) |
(1 << ShareLock) | (1 << ShareRowExclusiveLock) | LOCKBIT_ON(ShareLock) | LOCKBIT_ON(ShareRowExclusiveLock) |
(1 << ExclusiveLock) | (1 << AccessExclusiveLock), LOCKBIT_ON(ExclusiveLock) | LOCKBIT_ON(AccessExclusiveLock),
/* AccessExclusiveLock */ /* AccessExclusiveLock */
(1 << AccessShareLock) | (1 << RowShareLock) | LOCKBIT_ON(AccessShareLock) | LOCKBIT_ON(RowShareLock) |
(1 << RowExclusiveLock) | (1 << ShareUpdateExclusiveLock) | LOCKBIT_ON(RowExclusiveLock) | LOCKBIT_ON(ShareUpdateExclusiveLock) |
(1 << ShareLock) | (1 << ShareRowExclusiveLock) | LOCKBIT_ON(ShareLock) | LOCKBIT_ON(ShareRowExclusiveLock) |
(1 << ExclusiveLock) | (1 << AccessExclusiveLock) LOCKBIT_ON(ExclusiveLock) | LOCKBIT_ON(AccessExclusiveLock)
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment