diff options
Diffstat (limited to 'src/backend/storage/lmgr/lock.c')
-rw-r--r-- | src/backend/storage/lmgr/lock.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 640c36e5d1a..30078cbb161 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.19 1998/01/23 06:01:03 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.20 1998/01/23 22:16:46 momjian Exp $ * * NOTES * Outside modules can create a lock table and acquire/release @@ -708,6 +708,20 @@ LockResolveConflicts(LOCKTAB *ltable, result->nHolding = 0; } + { + /* ------------------------ + * If someone with a greater priority is waiting for the lock, + * do not continue and share the lock, even if we can. bjm + * ------------------------ + */ + int myprio = ltable->ctl->prio[lockt]; + PROC_QUEUE *waitQueue = &(lock->waitProcs); + PROC *topproc = (PROC *) MAKE_PTR(waitQueue->links.prev); + + if (waitQueue->size && topproc->prio > myprio) + return STATUS_FOUND; + } + /* ---------------------------- * first check for global conflicts: If no locks conflict * with mine, then I get the lock. |