diff options
| author | Bruce Momjian <bruce@momjian.us> | 2001-10-25 05:50:21 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2001-10-25 05:50:21 +0000 |
| commit | b81844b1738c584d92330a5ccd0fbd8b603d2886 (patch) | |
| tree | 4fae0d4cd26048177fc5cd1a2dd91abc99ba0f99 /src/backend/storage/lmgr/lock.c | |
| parent | 59da2105d8e6d95345b3b942a2e2aba8cead4838 (diff) | |
| download | postgresql-b81844b1738c584d92330a5ccd0fbd8b603d2886.tar.gz | |
pgindent run on all C files. Java run to follow. initdb/regression
tests pass.
Diffstat (limited to 'src/backend/storage/lmgr/lock.c')
| -rw-r--r-- | src/backend/storage/lmgr/lock.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 8c569710d0..a33b633d2d 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.100 2001/10/05 17:28:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.101 2001/10/25 05:49:42 momjian Exp $ * * NOTES * Outside modules can create a lock table and acquire/release @@ -42,7 +42,7 @@ /* This configuration variable is used to set the lock table size */ -int max_locks_per_xact; /* set by guc.c */ +int max_locks_per_xact; /* set by guc.c */ #define NLOCKENTS(maxBackends) (max_locks_per_xact * (maxBackends)) @@ -54,15 +54,15 @@ static void LockCountMyLocks(SHMEM_OFFSET lockOffset, PROC *proc, static char *lock_mode_names[] = { - "INVALID", - "AccessShareLock", - "RowShareLock", - "RowExclusiveLock", - "ShareUpdateExclusiveLock", - "ShareLock", - "ShareRowExclusiveLock", - "ExclusiveLock", - "AccessExclusiveLock" + "INVALID", + "AccessShareLock", + "RowShareLock", + "RowExclusiveLock", + "ShareUpdateExclusiveLock", + "ShareLock", + "ShareRowExclusiveLock", + "ExclusiveLock", + "AccessExclusiveLock" }; @@ -96,10 +96,10 @@ inline static bool LOCK_DEBUG_ENABLED(const LOCK *lock) { return - (((LOCK_LOCKMETHOD(*lock) == DEFAULT_LOCKMETHOD && Trace_locks) - || (LOCK_LOCKMETHOD(*lock) == USER_LOCKMETHOD && Trace_userlocks)) - && (lock->tag.relId >= (Oid) Trace_lock_oidmin)) - || (Trace_lock_table && (lock->tag.relId == Trace_lock_table)); + (((LOCK_LOCKMETHOD(*lock) == DEFAULT_LOCKMETHOD && Trace_locks) + || (LOCK_LOCKMETHOD(*lock) == USER_LOCKMETHOD && Trace_userlocks)) + && (lock->tag.relId >= (Oid) Trace_lock_oidmin)) + || (Trace_lock_table && (lock->tag.relId == Trace_lock_table)); } @@ -132,7 +132,7 @@ HOLDER_PRINT(const char *where, const HOLDER *holderP) || (HOLDER_LOCKMETHOD(*holderP) == USER_LOCKMETHOD && Trace_userlocks)) && (((LOCK *) MAKE_PTR(holderP->tag.lock))->tag.relId >= (Oid) Trace_lock_oidmin)) || (Trace_lock_table && (((LOCK *) MAKE_PTR(holderP->tag.lock))->tag.relId == Trace_lock_table)) - ) + ) elog(DEBUG, "%s: holder(%lx) lock(%lx) tbl(%d) proc(%lx) xid(%u) hold(%d,%d,%d,%d,%d,%d,%d)=%d", where, MAKE_OFFSET(holderP), holderP->tag.lock, @@ -147,7 +147,6 @@ HOLDER_PRINT(const char *where, const HOLDER *holderP) #define LOCK_PRINT(where, lock, type) #define HOLDER_PRINT(where, holderP) - #endif /* not LOCK_DEBUG */ @@ -647,9 +646,11 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag, else { Assert(status == STATUS_FOUND); + /* * We can't acquire the lock immediately. If caller specified no - * blocking, remove the holder entry and return FALSE without waiting. + * blocking, remove the holder entry and return FALSE without + * waiting. */ if (dontWait) { @@ -911,7 +912,6 @@ WaitOnLock(LOCKMETHOD lockmethod, LOCKMODE lockmode, lock, holder) != STATUS_OK) { - /* * We failed as a result of a deadlock, see HandleDeadLock(). Quit * now. Removal of the holder and lock objects, if no longer @@ -1114,7 +1114,6 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag, if (lock->nRequested == 0) { - /* * if there's no one waiting in the queue, we just released the * last lock on this object. Delete it from the lock table. @@ -1464,5 +1463,4 @@ DumpAllLocks(void) elog(DEBUG, "DumpAllLocks: holder->tag.lock = NULL"); } } - #endif /* LOCK_DEBUG */ |
