| 542 | |
| 543 | |
| 544 | static 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 | |
| 560 | static inline bool ConditionalAcquireContentLock(volatile BufferDesc *buf, |
| 561 | LWLockMode mode) |
no test coverage detected