mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Add transaction-level advisory locks.
They share the same locking namespace with the existing session-level advisory locks, but they are automatically released at the end of the current transaction and cannot be released explicitly via unlock functions. Marko Tiikkaja, reviewed by me.
This commit is contained in:
@ -629,8 +629,6 @@ LockWaitCancel(void)
|
||||
* At subtransaction abort, we release all locks held by the subtransaction;
|
||||
* this is implemented by retail releasing of the locks under control of
|
||||
* the ResourceOwner mechanism.
|
||||
*
|
||||
* Note that user locks are not released in any case.
|
||||
*/
|
||||
void
|
||||
ProcReleaseLocks(bool isCommit)
|
||||
@ -641,6 +639,9 @@ ProcReleaseLocks(bool isCommit)
|
||||
LockWaitCancel();
|
||||
/* Release locks */
|
||||
LockReleaseAll(DEFAULT_LOCKMETHOD, !isCommit);
|
||||
|
||||
/* Release transaction level advisory locks */
|
||||
LockReleaseAll(USER_LOCKMETHOD, false);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user