MCPcopy Create free account
hub / github.com/apache/cloudberry / BufferLockHeldByMe

Function BufferLockHeldByMe

src/backend/storage/buffer/bufmgr.c:5157–5173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5155/* This is used by PageGetLSN(). */
5156#ifdef USE_ASSERT_CHECKING
5157bool
5158BufferLockHeldByMe(Page page)
5159{
5160 char *pagePtr = page;
5161
5162 /*
5163 * We only want to assert that we hold a lock on the page contents if the
5164 * page is shared (i.e. it is one of the BufferBlocks).
5165 */
5166 if (BufferBlocks <= pagePtr &&
5167 pagePtr < (BufferBlocks + NBuffers * BLCKSZ))
5168 {
5169 BufferDesc *hdr = GetBufferDescriptor((pagePtr - BufferBlocks) / BLCKSZ);
5170 return LWLockHeldByMe(BufferDescriptorGetContentLock(hdr));
5171 }
5172 return true;
5173}
5174#endif

Callers 1

PageGetLSNFunction · 0.85

Calls 1

LWLockHeldByMeFunction · 0.85

Tested by

no test coverage detected