1
0
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:
Itagaki Takahiro
2011-02-18 14:04:34 +09:00
parent 87bb2ade2c
commit 62c7bd31c8
14 changed files with 814 additions and 71 deletions

View File

@ -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);
}