diff options
Diffstat (limited to 'src/backend/storage/lmgr/proc.c')
-rw-r--r-- | src/backend/storage/lmgr/proc.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 3fc24260315..650500de48b 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.42 1998/09/01 03:25:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.43 1998/09/01 04:32:02 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.42 1998/09/01 03:25:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.43 1998/09/01 04:32:02 momjian Exp $ */ #include <sys/time.h> #include <unistd.h> @@ -187,10 +187,10 @@ InitProcess(IPCKey key) { /* - * have to allocate one. We can't use the normal shmem index table - * mechanism because the proc structure is stored by PID instead - * of by a global name (need to look it up by PID when we cleanup - * dead processes). + * have to allocate one. We can't use the normal shmem index + * table mechanism because the proc structure is stored by PID + * instead of by a global name (need to look it up by PID when we + * cleanup dead processes). */ MyProc = (PROC *) ShmemAlloc((unsigned) sizeof(PROC)); @@ -364,6 +364,7 @@ ProcKill(int exitStatus, int pid) LockReleaseAll(DEFAULT_LOCKMETHOD, &proc->lockQueue); #ifdef USER_LOCKS + /* * Assume we have a second lock table. */ @@ -440,12 +441,12 @@ ProcQueueInit(PROC_QUEUE *queue) * NOTES: The process queue is now a priority queue for locking. */ int -ProcSleep(PROC_QUEUE *waitQueue, /* lock->waitProcs */ +ProcSleep(PROC_QUEUE *waitQueue,/* lock->waitProcs */ SPINLOCK spinlock, - int token, /* lockmode */ + int token, /* lockmode */ int prio, LOCK *lock, - TransactionId xid) /* needed by user locks, see below */ + TransactionId xid) /* needed by user locks, see below */ { int i; PROC *proc; @@ -561,7 +562,7 @@ ProcSleep(PROC_QUEUE *waitQueue, /* lock->waitProcs */ #ifdef LOCK_MGR_DEBUG /* Just to get meaningful debug messages from DumpLocks() */ - MyProc->waitLock = (LOCK *)NULL; + MyProc->waitLock = (LOCK *) NULL; #endif return MyProc->errType; @@ -620,13 +621,13 @@ ProcLockWakeup(PROC_QUEUE *queue, LOCKMETHOD lockmethod, LOCK *lock) count = 0; while ((queue_size--) && (proc)) { + /* - * This proc will conflict as the previous one did, don't even try. + * This proc will conflict as the previous one did, don't even + * try. */ if (proc->token == last_locktype) - { continue; - } /* * This proc conflicts with locks held by others, ignored. @@ -663,7 +664,8 @@ ProcLockWakeup(PROC_QUEUE *queue, LOCKMETHOD lockmethod, LOCK *lock) if (count) return STATUS_OK; - else { + else + { /* Something is still blocking us. May have deadlocked. */ trace_flag = (lock->tag.lockmethod == USER_LOCKMETHOD) ? \ TRACE_USERLOCKS : TRACE_LOCKS; |