8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
* NOTES
14
14
* Outside modules can create a lock table and acquire/release
@@ -492,14 +492,14 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag, LOCKMODE lockmode)
492
492
int is_user_lock ;
493
493
494
494
is_user_lock = (lockmethod == USER_LOCKMETHOD );
495
+ #ifdef USER_LOCKS_DEBUG
495
496
if (is_user_lock )
496
497
{
497
- #ifdef USER_LOCKS_DEBUG
498
498
TPRINTF (TRACE_USERLOCKS , "LockAcquire: user lock [%u] %s" ,
499
499
locktag -> objId .blkno ,
500
500
lock_types [lockmode ]);
501
- #endif
502
501
}
502
+ #endif
503
503
#endif
504
504
505
505
/* ???????? This must be changed when short term locks will be used */
@@ -1266,14 +1266,11 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue)
1266
1266
LOCK * lock ;
1267
1267
bool found ;
1268
1268
int trace_flag ;
1269
- int xidtag_lockmethod ;
1270
-
1271
- #ifdef USER_LOCKS
1272
- int is_user_lock_table ,
1273
- count ,
1269
+ int xidtag_lockmethod ,
1274
1270
nleft ;
1275
1271
1276
- count = nleft = 0 ;
1272
+ #ifdef USER_LOCKS
1273
+ int is_user_lock_table ;
1277
1274
1278
1275
is_user_lock_table = (lockmethod == USER_LOCKMETHOD );
1279
1276
trace_flag = (lockmethod == 2 ) ? TRACE_USERLOCKS : TRACE_LOCKS ;
@@ -1283,6 +1280,8 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue)
1283
1280
TPRINTF (trace_flag , "LockReleaseAll: lockmethod=%d, pid=%d" ,
1284
1281
lockmethod , MyProcPid );
1285
1282
1283
+ nleft = 0 ;
1284
+
1286
1285
Assert (lockmethod < NumLockMethods );
1287
1286
lockMethodTable = LockMethodTable [lockmethod ];
1288
1287
if (!lockMethodTable )
@@ -1304,16 +1303,6 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue)
1304
1303
{
1305
1304
bool wakeupNeeded = false;
1306
1305
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
-
1317
1306
/* ---------------------------
1318
1307
* XXX Here we assume the shared memory queue is circular and
1319
1308
* that we know its internal structure. Should have some sort of
@@ -1485,9 +1474,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue)
1485
1474
ProcLockWakeup (waitQueue , lockmethod , lock );
1486
1475
}
1487
1476
1488
- #ifdef USER_LOCKS
1489
1477
next_item :
1490
- #endif
1491
1478
if (done )
1492
1479
break ;
1493
1480
SHMQueueFirst (& xidLook -> queue , (Pointer * ) & tmp , & tmp -> queue );
0 commit comments