8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.82 2001/02/22 23:02:33 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.83 2001/02/22 23:20:06 momjian Exp $
12
12
*
13
13
* NOTES
14
14
* Outside modules can create a lock table and acquire/release
@@ -45,7 +45,7 @@ static int WaitOnLock(LOCKMETHOD lockmethod, LOCKMODE lockmode,
45
45
static void LockCountMyLocks (SHMEM_OFFSET lockOffset , PROC * proc ,
46
46
int * myHolding );
47
47
48
- static char * lock_types [] =
48
+ static char * lock_mode_names [] =
49
49
{
50
50
"INVALID" ,
51
51
"AccessShareLock" ,
@@ -65,16 +65,18 @@ static char *DeadLockMessage = "Deadlock detected.\n\tSee the lock(l) manual pag
65
65
/*------
66
66
* The following configuration options are available for lock debugging:
67
67
*
68
- * trace_locks -- give a bunch of output what's going on in this file
69
- * trace_userlocks -- same but for user locks
70
- * trace_lock_oidmin -- do not trace locks for tables below this oid
68
+ * TRACE_LOCKS -- give a bunch of output what's going on in this file
69
+ * TRACE_USERLOCKS -- same but for user locks
70
+ * TRACE_LOCK_OIDMIN -- do not trace locks for tables below this oid
71
71
* (use to avoid output on system tables)
72
- * trace_lock_table -- trace locks on this table (oid) unconditionally
73
- * debug_deadlocks -- currently dumps locks at untimely occasions ;)
72
+ * TRACE_LOCK_TABLE -- trace locks on this table (oid) unconditionally
73
+ * DEBUG_DEADLOCKS -- currently dumps locks at untimely occasions ;)
74
+ *
74
75
* Furthermore, but in storage/ipc/spin.c:
75
- * trace_spinlocks -- trace spinlocks (pretty useless)
76
+ * TRACE_SPINLOCKS -- trace spinlocks (pretty useless)
76
77
*
77
- * Define LOCK_DEBUG at compile time to get all this enabled.
78
+ * Define LOCK_DEBUG at compile time to get all these enabled.
79
+ * --------
78
80
*/
79
81
80
82
int Trace_lock_oidmin = BootstrapObjectIdData ;
@@ -112,7 +114,7 @@ LOCK_PRINT(const char * where, const LOCK * lock, LOCKMODE type)
112
114
lock -> granted [1 ], lock -> granted [2 ], lock -> granted [3 ],
113
115
lock -> granted [4 ], lock -> granted [5 ], lock -> granted [6 ],
114
116
lock -> granted [7 ], lock -> nGranted ,
115
- lock -> waitProcs .size , lock_types [type ]);
117
+ lock -> waitProcs .size , lock_mode_names [type ]);
116
118
}
117
119
118
120
@@ -494,7 +496,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
494
496
#ifdef LOCK_DEBUG
495
497
if (lockmethod == USER_LOCKMETHOD && Trace_userlocks )
496
498
elog (DEBUG , "LockAcquire: user lock [%u] %s" ,
497
- locktag -> objId .blkno , lock_types [lockmode ]);
499
+ locktag -> objId .blkno , lock_mode_names [lockmode ]);
498
500
#endif
499
501
500
502
/* ???????? This must be changed when short term locks will be used */
@@ -615,7 +617,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
615
617
break ; /* safe: we have a lock >= req level */
616
618
elog (DEBUG , "Deadlock risk: raising lock level"
617
619
" from %s to %s on object %u/%u/%u" ,
618
- lock_types [i ], lock_types [lockmode ],
620
+ lock_mode_names [i ], lock_mode_names [lockmode ],
619
621
lock -> tag .relId , lock -> tag .dbId , lock -> tag .objId .blkno );
620
622
break ;
621
623
}
@@ -1123,7 +1125,7 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
1123
1125
Assert (holder -> holding [lockmode ] >= 0 );
1124
1126
SpinRelease (masterLock );
1125
1127
elog (NOTICE , "LockRelease: you don't own a lock of type %s" ,
1126
- lock_types [lockmode ]);
1128
+ lock_mode_names [lockmode ]);
1127
1129
return FALSE;
1128
1130
}
1129
1131
Assert (holder -> nHolding > 0 );
0 commit comments