mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Improve LockAcquire API per my recent proposal. All error conditions
are now reported via elog, eliminating the need to test the result code at most call sites. Make it possible for the caller to distinguish a freshly acquired lock from one already held in the current transaction. Use that capability to avoid redundant AcceptInvalidationMessages() calls in LockRelation().
This commit is contained in:
@ -33,8 +33,8 @@ user_lock(uint32 id1, uint32 id2, LOCKMODE lockmode)
|
||||
|
||||
SET_LOCKTAG_USERLOCK(tag, id1, id2);
|
||||
|
||||
return LockAcquire(USER_LOCKMETHOD, &tag, InvalidTransactionId,
|
||||
lockmode, true);
|
||||
return (LockAcquire(USER_LOCKMETHOD, &tag, InvalidTransactionId,
|
||||
lockmode, true) != LOCKACQUIRE_NOT_AVAIL);
|
||||
}
|
||||
|
||||
int
|
||||
|
Reference in New Issue
Block a user