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

Function AcquireContentLock

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

Source from the content-addressed store, hash-verified

542
543
544static inline void AcquireContentLock(volatile BufferDesc *buf, LWLockMode mode)
545{
546#ifdef MPROTECT_BUFFERS
547 const bool newAcquisition =
548 !LWLockHeldByMe(BufferDescriptorGetContentLock(buf));
549
550 LWLockAcquire(BufferDescriptorGetContentLock(buf), mode);
551
552 /* new acquisition of content lock, allow read/write memory access */
553 if (newAcquisition)
554 BufferMProtect(buf, PROT_READ|PROT_WRITE);
555#else
556 LWLockAcquire(BufferDescriptorGetContentLock(buf), mode);
557#endif
558}
559
560static inline bool ConditionalAcquireContentLock(volatile BufferDesc *buf,
561 LWLockMode mode)

Callers 5

ReadBuffer_commonFunction · 0.85
SyncOneBufferFunction · 0.85
FlushRelationBuffersFunction · 0.85
FlushDatabaseBuffersFunction · 0.85
LockBufferFunction · 0.85

Calls 3

LWLockHeldByMeFunction · 0.85
LWLockAcquireFunction · 0.85
BufferMProtectFunction · 0.85

Tested by

no test coverage detected