88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.66 2000/02/22 09:55:20 inoue Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.67 2000/04/30 21:23:31 tgl Exp $
1212 *
1313 * NOTES
1414 * Outside modules can create a lock table and acquire/release
@@ -492,14 +492,14 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag, LOCKMODE lockmode)
492492int is_user_lock ;
493493
494494is_user_lock = (lockmethod == USER_LOCKMETHOD );
495+ #ifdef USER_LOCKS_DEBUG
495496if (is_user_lock )
496497{
497- #ifdef USER_LOCKS_DEBUG
498498TPRINTF (TRACE_USERLOCKS ,"LockAcquire: user lock [%u] %s" ,
499499locktag -> objId .blkno ,
500500lock_types [lockmode ]);
501- #endif
502501}
502+ #endif
503503#endif
504504
505505/* ???????? This must be changed when short term locks will be used */
@@ -1266,14 +1266,11 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue)
12661266LOCK * lock ;
12671267bool found ;
12681268int trace_flag ;
1269- int xidtag_lockmethod ;
1270-
1271- #ifdef USER_LOCKS
1272- int is_user_lock_table ,
1273- count ,
1269+ int xidtag_lockmethod ,
12741270nleft ;
12751271
1276- count = nleft = 0 ;
1272+ #ifdef USER_LOCKS
1273+ int is_user_lock_table ;
12771274
12781275is_user_lock_table = (lockmethod == USER_LOCKMETHOD );
12791276trace_flag = (lockmethod == 2 ) ?TRACE_USERLOCKS :TRACE_LOCKS ;
@@ -1283,6 +1280,8 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue)
12831280TPRINTF (trace_flag ,"LockReleaseAll: lockmethod=%d, pid=%d" ,
12841281lockmethod ,MyProcPid );
12851282
1283+ nleft = 0 ;
1284+
12861285Assert (lockmethod < NumLockMethods );
12871286lockMethodTable = LockMethodTable [lockmethod ];
12881287if (!lockMethodTable )
@@ -1304,16 +1303,6 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue)
13041303{
13051304bool wakeupNeeded = false;
13061305
1307- /*
1308- * Sometimes the queue appears to be messed up.
1309- */
1310- if (count ++ > 1000 )
1311- {
1312- elog (NOTICE ,"LockReleaseAll: xid loop detected, giving up" );
1313- nleft = 0 ;
1314- break ;
1315- }
1316-
13171306/* ---------------------------
13181307 * XXX Here we assume the shared memory queue is circular and
13191308 * that we know its internal structure. Should have some sort of
@@ -1485,9 +1474,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue)
14851474ProcLockWakeup (waitQueue ,lockmethod ,lock );
14861475}
14871476
1488- #ifdef USER_LOCKS
14891477next_item :
1490- #endif
14911478if (done )
14921479break ;
14931480SHMQueueFirst (& xidLook -> queue , (Pointer * )& tmp ,& tmp -> queue );