* FastPathStrongRelationLocks->counts becomes visible after we test
* it has yet to begin to transfer fast-path locks.
*/
- LWLockAcquire(MyProc->backendLock, LW_EXCLUSIVE);
+ LWLockAcquire(&MyProc->backendLock, LW_EXCLUSIVE);
if (FastPathStrongRelationLocks->count[fasthashcode] != 0)
acquired = false;
else
acquired = FastPathGrantRelationLock(locktag->locktag_field2,
lockmode);
- LWLockRelease(MyProc->backendLock);
+ LWLockRelease(&MyProc->backendLock);
if (acquired)
{
/*
* We might not find the lock here, even if we originally entered it
* here. Another backend may have moved it to the main table.
*/
- LWLockAcquire(MyProc->backendLock, LW_EXCLUSIVE);
+ LWLockAcquire(&MyProc->backendLock, LW_EXCLUSIVE);
released = FastPathUnGrantRelationLock(locktag->locktag_field2,
lockmode);
- LWLockRelease(MyProc->backendLock);
+ LWLockRelease(&MyProc->backendLock);
if (released)
{
RemoveLocalLock(locallock);
*/
if (!have_fast_path_lwlock)
{
- LWLockAcquire(MyProc->backendLock, LW_EXCLUSIVE);
+ LWLockAcquire(&MyProc->backendLock, LW_EXCLUSIVE);
have_fast_path_lwlock = true;
}
* transferred to the main lock table. That's going to require
* some extra work, so release our fast-path lock before starting.
*/
- LWLockRelease(MyProc->backendLock);
+ LWLockRelease(&MyProc->backendLock);
have_fast_path_lwlock = false;
/*
/* Done with the fast-path data structures */
if (have_fast_path_lwlock)
- LWLockRelease(MyProc->backendLock);
+ LWLockRelease(&MyProc->backendLock);
/*
* Now, scan each lock partition separately.
PGPROC *proc = &ProcGlobal->allProcs[i];
uint32 f;
- LWLockAcquire(proc->backendLock, LW_EXCLUSIVE);
+ LWLockAcquire(&proc->backendLock, LW_EXCLUSIVE);
/*
* If the target backend isn't referencing the same database as the
*
* proc->databaseId is set at backend startup time and never changes
* thereafter, so it might be safe to perform this test before
- * acquiring proc->backendLock. In particular, it's certainly safe to
+ * acquiring &proc->backendLock. In particular, it's certainly safe to
* assume that if the target backend holds any fast-path locks, it
* must have performed a memory-fencing operation (in particular, an
* LWLock acquisition) since setting proc->databaseId. However, it's
*/
if (proc->databaseId != locktag->locktag_field1)
{
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
continue;
}
if (!proclock)
{
LWLockRelease(partitionLock);
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
return false;
}
GrantLock(proclock->tag.myLock, proclock, lockmode);
/* No need to examine remaining slots. */
break;
}
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
}
return true;
}
Oid relid = locktag->locktag_field2;
uint32 f;
- LWLockAcquire(MyProc->backendLock, LW_EXCLUSIVE);
+ LWLockAcquire(&MyProc->backendLock, LW_EXCLUSIVE);
for (f = 0; f < FP_LOCK_SLOTS_PER_BACKEND; f++)
{
if (!proclock)
{
LWLockRelease(partitionLock);
- LWLockRelease(MyProc->backendLock);
+ LWLockRelease(&MyProc->backendLock);
ereport(ERROR,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of shared memory"),
break;
}
- LWLockRelease(MyProc->backendLock);
+ LWLockRelease(&MyProc->backendLock);
/* Lock may have already been transferred by some other backend. */
if (proclock == NULL)
if (proc == MyProc)
continue;
- LWLockAcquire(proc->backendLock, LW_SHARED);
+ LWLockAcquire(&proc->backendLock, LW_SHARED);
/*
* If the target backend isn't referencing the same database as
*/
if (proc->databaseId != locktag->locktag_field1)
{
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
continue;
}
break;
}
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
}
}
PGPROC *proc = &ProcGlobal->allProcs[i];
uint32 f;
- LWLockAcquire(proc->backendLock, LW_SHARED);
+ LWLockAcquire(&proc->backendLock, LW_SHARED);
for (f = 0; f < FP_LOCK_SLOTS_PER_BACKEND; ++f)
{
el++;
}
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
}
/*
{
Assert(VirtualTransactionIdIsValid(vxid));
- LWLockAcquire(MyProc->backendLock, LW_EXCLUSIVE);
+ LWLockAcquire(&MyProc->backendLock, LW_EXCLUSIVE);
Assert(MyProc->backendId == vxid.backendId);
Assert(MyProc->fpLocalTransactionId == InvalidLocalTransactionId);
MyProc->fpVXIDLock = true;
MyProc->fpLocalTransactionId = vxid.localTransactionId;
- LWLockRelease(MyProc->backendLock);
+ LWLockRelease(&MyProc->backendLock);
}
/*
/*
* Clean up shared memory state.
*/
- LWLockAcquire(MyProc->backendLock, LW_EXCLUSIVE);
+ LWLockAcquire(&MyProc->backendLock, LW_EXCLUSIVE);
fastpath = MyProc->fpVXIDLock;
lxid = MyProc->fpLocalTransactionId;
MyProc->fpVXIDLock = false;
MyProc->fpLocalTransactionId = InvalidLocalTransactionId;
- LWLockRelease(MyProc->backendLock);
+ LWLockRelease(&MyProc->backendLock);
/*
* If fpVXIDLock has been cleared without touching fpLocalTransactionId,
* against the ones we're waiting for. The target backend will only set
* or clear lxid while holding this lock.
*/
- LWLockAcquire(proc->backendLock, LW_EXCLUSIVE);
+ LWLockAcquire(&proc->backendLock, LW_EXCLUSIVE);
/* If the transaction has ended, our work here is done. */
if (proc->backendId != vxid.backendId
|| proc->fpLocalTransactionId != vxid.localTransactionId)
{
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
return true;
}
*/
if (!wait)
{
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
return false;
}
if (!proclock)
{
LWLockRelease(partitionLock);
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
ereport(ERROR,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of shared memory"),
}
/* Done with proc->fpLockBits */
- LWLockRelease(proc->backendLock);
+ LWLockRelease(&proc->backendLock);
/* Time to wait. */
(void) LockAcquire(&tag, ShareLock, false, false);