1
0
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:
Tom Lane
2005-05-29 22:45:02 +00:00
parent 299c442077
commit 140b078d2a
4 changed files with 81 additions and 69 deletions

View File

@ -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