mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Add debug check function LWLockHeldByMeInMode()
Tests whether my process holds a lock in given mode. Add initial usage in MarkBufferDirty(). Thomas Munro
This commit is contained in:
@ -1460,8 +1460,8 @@ MarkBufferDirty(Buffer buffer)
|
||||
bufHdr = GetBufferDescriptor(buffer - 1);
|
||||
|
||||
Assert(BufferIsPinned(buffer));
|
||||
/* unfortunately we can't check if the lock is held exclusively */
|
||||
Assert(LWLockHeldByMe(BufferDescriptorGetContentLock(bufHdr)));
|
||||
Assert(LWLockHeldByMeInMode(BufferDescriptorGetContentLock(bufHdr),
|
||||
LW_EXCLUSIVE));
|
||||
|
||||
old_buf_state = pg_atomic_read_u32(&bufHdr->state);
|
||||
for (;;)
|
||||
|
Reference in New Issue
Block a user