MultiXactOffset *next_offptr;
MultiXactOffset next_offset;
- LWLockAcquire(MultiXactOffsetSLRULock, LW_EXCLUSIVE);
-
/* position of this multixid in the offsets SLRU area */
pageno = MultiXactIdToOffsetPage(multi);
entryno = MultiXactIdToOffsetEntry(multi);
{
elog(DEBUG1, "next offsets page is not initialized, initializing it now");
+ LWLockAcquire(MultiXactOffsetSLRULock, LW_EXCLUSIVE);
+
/* Create and zero the page */
slotno = SimpleLruZeroPage(MultiXactOffsetCtl, next_pageno);
SimpleLruWritePage(MultiXactOffsetCtl, slotno);
Assert(!MultiXactOffsetCtl->shared->page_dirty[slotno]);
+ LWLockRelease(MultiXactOffsetSLRULock);
+
/*
* Remember that we initialized the page, so that we don't zero it
* again at the XLOG_MULTIXACT_ZERO_OFF_PAGE record.
* concurrently, we might race ahead and get called before the previous
* multixid.
*/
+ LWLockAcquire(MultiXactOffsetSLRULock, LW_EXCLUSIVE);
/*
* Note: we pass the MultiXactId to SimpleLruReadPage as the "transaction"