diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-02-24 19:58:26 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-02-24 19:58:26 +0000 |
commit | 19ba2292993933947b72da984580cf885179128b (patch) | |
tree | 9b35cdb934963c4e5fa34d320020a65fc33bac34 /src | |
parent | f0da7129f514dfb9873a999f1370609ac986e922 (diff) | |
download | postgresql-19ba2292993933947b72da984580cf885179128b.tar.gz postgresql-19ba2292993933947b72da984580cf885179128b.zip |
Fix for locking problems an dpriority.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/lmgr/proc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index d3631a143b3..057a4c11965 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.31 1998/02/19 15:04:45 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.32 1998/02/24 19:58:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -46,7 +46,7 @@ * This is so that we can support more backends. (system-wide semaphore * sets run out pretty fast.) -ay 4/95 * - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.31 1998/02/19 15:04:45 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.32 1998/02/24 19:58:26 momjian Exp $ */ #include <sys/time.h> #include <unistd.h> @@ -451,7 +451,7 @@ ProcSleep(PROC_QUEUE *waitQueue, int prio, LOCK *lock) { - int i = 0; + int i; PROC *proc; struct itimerval timeval, dummy; @@ -481,7 +481,8 @@ ProcSleep(PROC_QUEUE *waitQueue, proc = (PROC *) MAKE_PTR(waitQueue->links.prev); /* If we are a reader, and they are writers, skip past them */ - while (i++ < waitQueue->size && proc->prio > prio) + + for (i = 0; i < waitQueue->size && proc->prio > prio; i++) proc = (PROC *) MAKE_PTR(proc->links.prev); /* The rest of the queue is FIFO, with readers first, writers last */ |