mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Back out change. Too many place to change too close to beta:
* HOLDER/HOLDERTAB rename to PROCLOCKLINK/PROCLOCKLINKTAG (Bruce) Will return later.
This commit is contained in:
parent
1663f33838
commit
0386ccfed1
4
doc/TODO
4
doc/TODO
@ -1,6 +1,6 @@
|
|||||||
TODO list for PostgreSQL
|
TODO list for PostgreSQL
|
||||||
========================
|
========================
|
||||||
Last updated: Sat Sep 29 17:34:59 EDT 2001
|
Last updated: Sat Sep 29 20:43:59 EDT 2001
|
||||||
|
|
||||||
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
|
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ SOURCE CODE
|
|||||||
* Make sure all block numbers are unsigned to increase maximum table size
|
* Make sure all block numbers are unsigned to increase maximum table size
|
||||||
* Use BlockNumber rather than int where appropriate
|
* Use BlockNumber rather than int where appropriate
|
||||||
* Merge LockMethodCtl and LockMethodTable into one shared structure (Bruce)
|
* Merge LockMethodCtl and LockMethodTable into one shared structure (Bruce)
|
||||||
* -HOLDER/HOLDERTAB rename to PROCLOCKLINK/PROCLOCKLINKTAG (Bruce)
|
* HOLDER/HOLDERTAB rename to PROCLOCKLINK/PROCLOCKLINKTAG (Bruce)
|
||||||
* Add version file format stamp to heap and other table types
|
* Add version file format stamp to heap and other table types
|
||||||
* -Make elog(LOG) in WAL its own output type, distinct from DEBUG (Peter E)
|
* -Make elog(LOG) in WAL its own output type, distinct from DEBUG (Peter E)
|
||||||
* Rename some /contrib modules from pg* to pg_*
|
* Rename some /contrib modules from pg* to pg_*
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/deadlock.c,v 1.5 2001/09/29 21:35:14 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/deadlock.c,v 1.6 2001/09/30 00:45:47 momjian Exp $
|
||||||
*
|
*
|
||||||
* Interface:
|
* Interface:
|
||||||
*
|
*
|
||||||
@ -382,7 +382,7 @@ FindLockCycleRecurse(PROC *checkProc,
|
|||||||
{
|
{
|
||||||
PROC *proc;
|
PROC *proc;
|
||||||
LOCK *lock;
|
LOCK *lock;
|
||||||
PROCLOCK *holder;
|
HOLDER *holder;
|
||||||
SHM_QUEUE *lockHolders;
|
SHM_QUEUE *lockHolders;
|
||||||
LOCKMETHODTABLE *lockMethodTable;
|
LOCKMETHODTABLE *lockMethodTable;
|
||||||
LOCKMETHODCTL *lockctl;
|
LOCKMETHODCTL *lockctl;
|
||||||
@ -434,8 +434,8 @@ FindLockCycleRecurse(PROC *checkProc,
|
|||||||
*/
|
*/
|
||||||
lockHolders = &(lock->lockHolders);
|
lockHolders = &(lock->lockHolders);
|
||||||
|
|
||||||
holder = (PROCLOCK *) SHMQueueNext(lockHolders, lockHolders,
|
holder = (HOLDER *) SHMQueueNext(lockHolders, lockHolders,
|
||||||
offsetof(PROCLOCK, lockLink));
|
offsetof(HOLDER, lockLink));
|
||||||
|
|
||||||
while (holder)
|
while (holder)
|
||||||
{
|
{
|
||||||
@ -458,8 +458,8 @@ FindLockCycleRecurse(PROC *checkProc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
holder = (PROCLOCK *) SHMQueueNext(lockHolders, &holder->lockLink,
|
holder = (HOLDER *) SHMQueueNext(lockHolders, &holder->lockLink,
|
||||||
offsetof(PROCLOCK, lockLink));
|
offsetof(HOLDER, lockLink));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.97 2001/09/29 21:35:14 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.98 2001/09/30 00:45:47 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Outside modules can create a lock table and acquire/release
|
* Outside modules can create a lock table and acquire/release
|
||||||
@ -48,7 +48,7 @@ int max_locks_per_xact; /* set by guc.c */
|
|||||||
|
|
||||||
|
|
||||||
static int WaitOnLock(LOCKMETHOD lockmethod, LOCKMODE lockmode,
|
static int WaitOnLock(LOCKMETHOD lockmethod, LOCKMODE lockmode,
|
||||||
LOCK *lock, PROCLOCK *holder);
|
LOCK *lock, HOLDER *holder);
|
||||||
static void LockCountMyLocks(SHMEM_OFFSET lockOffset, PROC *proc,
|
static void LockCountMyLocks(SHMEM_OFFSET lockOffset, PROC *proc,
|
||||||
int *myHolding);
|
int *myHolding);
|
||||||
|
|
||||||
@ -125,18 +125,18 @@ LOCK_PRINT(const char *where, const LOCK *lock, LOCKMODE type)
|
|||||||
|
|
||||||
|
|
||||||
inline static void
|
inline static void
|
||||||
PROCLOCK_PRINT(const char *where, const PROCLOCK *holderP)
|
HOLDER_PRINT(const char *where, const HOLDER *holderP)
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
(((PROCLOCK_LOCKMETHOD(*holderP) == DEFAULT_LOCKMETHOD && Trace_locks)
|
(((HOLDER_LOCKMETHOD(*holderP) == DEFAULT_LOCKMETHOD && Trace_locks)
|
||||||
|| (PROCLOCK_LOCKMETHOD(*holderP) == USER_LOCKMETHOD && Trace_userlocks))
|
|| (HOLDER_LOCKMETHOD(*holderP) == USER_LOCKMETHOD && Trace_userlocks))
|
||||||
&& (((LOCK *) MAKE_PTR(holderP->tag.lock))->tag.relId >= (Oid) Trace_lock_oidmin))
|
&& (((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))
|
|| (Trace_lock_table && (((LOCK *) MAKE_PTR(holderP->tag.lock))->tag.relId == Trace_lock_table))
|
||||||
)
|
)
|
||||||
elog(DEBUG,
|
elog(DEBUG,
|
||||||
"%s: holder(%lx) lock(%lx) tbl(%d) proc(%lx) xid(%u) hold(%d,%d,%d,%d,%d,%d,%d)=%d",
|
"%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,
|
where, MAKE_OFFSET(holderP), holderP->tag.lock,
|
||||||
PROCLOCK_LOCKMETHOD(*(holderP)),
|
HOLDER_LOCKMETHOD(*(holderP)),
|
||||||
holderP->tag.proc, holderP->tag.xid,
|
holderP->tag.proc, holderP->tag.xid,
|
||||||
holderP->holding[1], holderP->holding[2], holderP->holding[3],
|
holderP->holding[1], holderP->holding[2], holderP->holding[3],
|
||||||
holderP->holding[4], holderP->holding[5], holderP->holding[6],
|
holderP->holding[4], holderP->holding[5], holderP->holding[6],
|
||||||
@ -146,7 +146,7 @@ PROCLOCK_PRINT(const char *where, const PROCLOCK *holderP)
|
|||||||
#else /* not LOCK_DEBUG */
|
#else /* not LOCK_DEBUG */
|
||||||
|
|
||||||
#define LOCK_PRINT(where, lock, type)
|
#define LOCK_PRINT(where, lock, type)
|
||||||
#define PROCLOCK_PRINT(where, holderP)
|
#define HOLDER_PRINT(where, holderP)
|
||||||
|
|
||||||
#endif /* not LOCK_DEBUG */
|
#endif /* not LOCK_DEBUG */
|
||||||
|
|
||||||
@ -325,11 +325,11 @@ LockMethodTableInit(char *tabName,
|
|||||||
Assert(lockMethodTable->lockHash->hash == tag_hash);
|
Assert(lockMethodTable->lockHash->hash == tag_hash);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* allocate a hash table for PROCLOCK structs. This is used to store
|
* allocate a hash table for HOLDER structs. This is used to store
|
||||||
* per-lock-holder information.
|
* per-lock-holder information.
|
||||||
*/
|
*/
|
||||||
info.keysize = SHMEM_PROCLOCKTAB_KEYSIZE;
|
info.keysize = SHMEM_HOLDERTAB_KEYSIZE;
|
||||||
info.datasize = SHMEM_PROCLOCKTAB_DATASIZE;
|
info.datasize = SHMEM_HOLDERTAB_DATASIZE;
|
||||||
info.hash = tag_hash;
|
info.hash = tag_hash;
|
||||||
hash_flags = (HASH_ELEM | HASH_FUNCTION);
|
hash_flags = (HASH_ELEM | HASH_FUNCTION);
|
||||||
|
|
||||||
@ -449,8 +449,8 @@ bool
|
|||||||
LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
||||||
TransactionId xid, LOCKMODE lockmode, bool dontWait)
|
TransactionId xid, LOCKMODE lockmode, bool dontWait)
|
||||||
{
|
{
|
||||||
PROCLOCK *holder;
|
HOLDER *holder;
|
||||||
PROCLOCKTAG holdertag;
|
HOLDERTAG holdertag;
|
||||||
HTAB *holderTable;
|
HTAB *holderTable;
|
||||||
bool found;
|
bool found;
|
||||||
LOCK *lock;
|
LOCK *lock;
|
||||||
@ -520,7 +520,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
/*
|
/*
|
||||||
* Create the hash key for the holder table.
|
* Create the hash key for the holder table.
|
||||||
*/
|
*/
|
||||||
MemSet(&holdertag, 0, sizeof(PROCLOCKTAG)); /* must clear padding,
|
MemSet(&holdertag, 0, sizeof(HOLDERTAG)); /* must clear padding,
|
||||||
* needed */
|
* needed */
|
||||||
holdertag.lock = MAKE_OFFSET(lock);
|
holdertag.lock = MAKE_OFFSET(lock);
|
||||||
holdertag.proc = MAKE_OFFSET(MyProc);
|
holdertag.proc = MAKE_OFFSET(MyProc);
|
||||||
@ -530,7 +530,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
* Find or create a holder entry with this tag
|
* Find or create a holder entry with this tag
|
||||||
*/
|
*/
|
||||||
holderTable = lockMethodTable->holderHash;
|
holderTable = lockMethodTable->holderHash;
|
||||||
holder = (PROCLOCK *) hash_search(holderTable, (Pointer) &holdertag,
|
holder = (HOLDER *) hash_search(holderTable, (Pointer) &holdertag,
|
||||||
HASH_ENTER, &found);
|
HASH_ENTER, &found);
|
||||||
if (!holder)
|
if (!holder)
|
||||||
{
|
{
|
||||||
@ -549,11 +549,11 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
/* Add holder to appropriate lists */
|
/* Add holder to appropriate lists */
|
||||||
SHMQueueInsertBefore(&lock->lockHolders, &holder->lockLink);
|
SHMQueueInsertBefore(&lock->lockHolders, &holder->lockLink);
|
||||||
SHMQueueInsertBefore(&MyProc->procHolders, &holder->procLink);
|
SHMQueueInsertBefore(&MyProc->procHolders, &holder->procLink);
|
||||||
PROCLOCK_PRINT("LockAcquire: new", holder);
|
HOLDER_PRINT("LockAcquire: new", holder);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PROCLOCK_PRINT("LockAcquire: found", holder);
|
HOLDER_PRINT("LockAcquire: found", holder);
|
||||||
Assert((holder->nHolding >= 0) && (holder->holding[lockmode] >= 0));
|
Assert((holder->nHolding >= 0) && (holder->holding[lockmode] >= 0));
|
||||||
Assert(holder->nHolding <= lock->nGranted);
|
Assert(holder->nHolding <= lock->nGranted);
|
||||||
|
|
||||||
@ -606,7 +606,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
if (holder->holding[lockmode] > 0)
|
if (holder->holding[lockmode] > 0)
|
||||||
{
|
{
|
||||||
GrantLock(lock, holder, lockmode);
|
GrantLock(lock, holder, lockmode);
|
||||||
PROCLOCK_PRINT("LockAcquire: owning", holder);
|
HOLDER_PRINT("LockAcquire: owning", holder);
|
||||||
LWLockRelease(masterLock);
|
LWLockRelease(masterLock);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -619,7 +619,7 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
if (myHolding[lockmode] > 0)
|
if (myHolding[lockmode] > 0)
|
||||||
{
|
{
|
||||||
GrantLock(lock, holder, lockmode);
|
GrantLock(lock, holder, lockmode);
|
||||||
PROCLOCK_PRINT("LockAcquire: my other XID owning", holder);
|
HOLDER_PRINT("LockAcquire: my other XID owning", holder);
|
||||||
LWLockRelease(masterLock);
|
LWLockRelease(masterLock);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -654,14 +654,14 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
{
|
{
|
||||||
SHMQueueDelete(&holder->lockLink);
|
SHMQueueDelete(&holder->lockLink);
|
||||||
SHMQueueDelete(&holder->procLink);
|
SHMQueueDelete(&holder->procLink);
|
||||||
holder = (PROCLOCK *) hash_search(holderTable,
|
holder = (HOLDER *) hash_search(holderTable,
|
||||||
(Pointer) holder,
|
(Pointer) holder,
|
||||||
HASH_REMOVE, &found);
|
HASH_REMOVE, &found);
|
||||||
if (!holder || !found)
|
if (!holder || !found)
|
||||||
elog(NOTICE, "LockAcquire: remove holder, table corrupted");
|
elog(NOTICE, "LockAcquire: remove holder, table corrupted");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
PROCLOCK_PRINT("LockAcquire: NHOLDING", holder);
|
HOLDER_PRINT("LockAcquire: NHOLDING", holder);
|
||||||
lock->nRequested--;
|
lock->nRequested--;
|
||||||
lock->requested[lockmode]--;
|
lock->requested[lockmode]--;
|
||||||
LOCK_PRINT("LockAcquire: conditional lock failed", lock, lockmode);
|
LOCK_PRINT("LockAcquire: conditional lock failed", lock, lockmode);
|
||||||
@ -706,13 +706,13 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
*/
|
*/
|
||||||
if (!((holder->nHolding > 0) && (holder->holding[lockmode] > 0)))
|
if (!((holder->nHolding > 0) && (holder->holding[lockmode] > 0)))
|
||||||
{
|
{
|
||||||
PROCLOCK_PRINT("LockAcquire: INCONSISTENT", holder);
|
HOLDER_PRINT("LockAcquire: INCONSISTENT", holder);
|
||||||
LOCK_PRINT("LockAcquire: INCONSISTENT", lock, lockmode);
|
LOCK_PRINT("LockAcquire: INCONSISTENT", lock, lockmode);
|
||||||
/* Should we retry ? */
|
/* Should we retry ? */
|
||||||
LWLockRelease(masterLock);
|
LWLockRelease(masterLock);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
PROCLOCK_PRINT("LockAcquire: granted", holder);
|
HOLDER_PRINT("LockAcquire: granted", holder);
|
||||||
LOCK_PRINT("LockAcquire: granted", lock, lockmode);
|
LOCK_PRINT("LockAcquire: granted", lock, lockmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -741,7 +741,7 @@ int
|
|||||||
LockCheckConflicts(LOCKMETHODTABLE *lockMethodTable,
|
LockCheckConflicts(LOCKMETHODTABLE *lockMethodTable,
|
||||||
LOCKMODE lockmode,
|
LOCKMODE lockmode,
|
||||||
LOCK *lock,
|
LOCK *lock,
|
||||||
PROCLOCK *holder,
|
HOLDER *holder,
|
||||||
PROC *proc,
|
PROC *proc,
|
||||||
int *myHolding) /* myHolding[] array or NULL */
|
int *myHolding) /* myHolding[] array or NULL */
|
||||||
{
|
{
|
||||||
@ -763,7 +763,7 @@ LockCheckConflicts(LOCKMETHODTABLE *lockMethodTable,
|
|||||||
*/
|
*/
|
||||||
if (!(lockctl->conflictTab[lockmode] & lock->grantMask))
|
if (!(lockctl->conflictTab[lockmode] & lock->grantMask))
|
||||||
{
|
{
|
||||||
PROCLOCK_PRINT("LockCheckConflicts: no conflict", holder);
|
HOLDER_PRINT("LockCheckConflicts: no conflict", holder);
|
||||||
return STATUS_OK;
|
return STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -797,11 +797,11 @@ LockCheckConflicts(LOCKMETHODTABLE *lockMethodTable,
|
|||||||
if (!(lockctl->conflictTab[lockmode] & bitmask))
|
if (!(lockctl->conflictTab[lockmode] & bitmask))
|
||||||
{
|
{
|
||||||
/* no conflict. OK to get the lock */
|
/* no conflict. OK to get the lock */
|
||||||
PROCLOCK_PRINT("LockCheckConflicts: resolved", holder);
|
HOLDER_PRINT("LockCheckConflicts: resolved", holder);
|
||||||
return STATUS_OK;
|
return STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
PROCLOCK_PRINT("LockCheckConflicts: conflicting", holder);
|
HOLDER_PRINT("LockCheckConflicts: conflicting", holder);
|
||||||
return STATUS_FOUND;
|
return STATUS_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -819,13 +819,13 @@ static void
|
|||||||
LockCountMyLocks(SHMEM_OFFSET lockOffset, PROC *proc, int *myHolding)
|
LockCountMyLocks(SHMEM_OFFSET lockOffset, PROC *proc, int *myHolding)
|
||||||
{
|
{
|
||||||
SHM_QUEUE *procHolders = &(proc->procHolders);
|
SHM_QUEUE *procHolders = &(proc->procHolders);
|
||||||
PROCLOCK *holder;
|
HOLDER *holder;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
MemSet(myHolding, 0, MAX_LOCKMODES * sizeof(int));
|
MemSet(myHolding, 0, MAX_LOCKMODES * sizeof(int));
|
||||||
|
|
||||||
holder = (PROCLOCK *) SHMQueueNext(procHolders, procHolders,
|
holder = (HOLDER *) SHMQueueNext(procHolders, procHolders,
|
||||||
offsetof(PROCLOCK, procLink));
|
offsetof(HOLDER, procLink));
|
||||||
|
|
||||||
while (holder)
|
while (holder)
|
||||||
{
|
{
|
||||||
@ -835,8 +835,8 @@ LockCountMyLocks(SHMEM_OFFSET lockOffset, PROC *proc, int *myHolding)
|
|||||||
myHolding[i] += holder->holding[i];
|
myHolding[i] += holder->holding[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
holder = (PROCLOCK *) SHMQueueNext(procHolders, &holder->procLink,
|
holder = (HOLDER *) SHMQueueNext(procHolders, &holder->procLink,
|
||||||
offsetof(PROCLOCK, procLink));
|
offsetof(HOLDER, procLink));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -848,7 +848,7 @@ LockCountMyLocks(SHMEM_OFFSET lockOffset, PROC *proc, int *myHolding)
|
|||||||
* and have its waitLock/waitHolder fields cleared. That's not done here.
|
* and have its waitLock/waitHolder fields cleared. That's not done here.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
GrantLock(LOCK *lock, PROCLOCK *holder, LOCKMODE lockmode)
|
GrantLock(LOCK *lock, HOLDER *holder, LOCKMODE lockmode)
|
||||||
{
|
{
|
||||||
lock->nGranted++;
|
lock->nGranted++;
|
||||||
lock->granted[lockmode]++;
|
lock->granted[lockmode]++;
|
||||||
@ -873,7 +873,7 @@ GrantLock(LOCK *lock, PROCLOCK *holder, LOCKMODE lockmode)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
WaitOnLock(LOCKMETHOD lockmethod, LOCKMODE lockmode,
|
WaitOnLock(LOCKMETHOD lockmethod, LOCKMODE lockmode,
|
||||||
LOCK *lock, PROCLOCK *holder)
|
LOCK *lock, HOLDER *holder)
|
||||||
{
|
{
|
||||||
LOCKMETHODTABLE *lockMethodTable = LockMethodTable[lockmethod];
|
LOCKMETHODTABLE *lockMethodTable = LockMethodTable[lockmethod];
|
||||||
char *new_status,
|
char *new_status,
|
||||||
@ -991,8 +991,8 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
LWLockId masterLock;
|
LWLockId masterLock;
|
||||||
bool found;
|
bool found;
|
||||||
LOCKMETHODTABLE *lockMethodTable;
|
LOCKMETHODTABLE *lockMethodTable;
|
||||||
PROCLOCK *holder;
|
HOLDER *holder;
|
||||||
PROCLOCKTAG holdertag;
|
HOLDERTAG holdertag;
|
||||||
HTAB *holderTable;
|
HTAB *holderTable;
|
||||||
bool wakeupNeeded = false;
|
bool wakeupNeeded = false;
|
||||||
|
|
||||||
@ -1044,14 +1044,14 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
/*
|
/*
|
||||||
* Find the holder entry for this holder.
|
* Find the holder entry for this holder.
|
||||||
*/
|
*/
|
||||||
MemSet(&holdertag, 0, sizeof(PROCLOCKTAG)); /* must clear padding,
|
MemSet(&holdertag, 0, sizeof(HOLDERTAG)); /* must clear padding,
|
||||||
* needed */
|
* needed */
|
||||||
holdertag.lock = MAKE_OFFSET(lock);
|
holdertag.lock = MAKE_OFFSET(lock);
|
||||||
holdertag.proc = MAKE_OFFSET(MyProc);
|
holdertag.proc = MAKE_OFFSET(MyProc);
|
||||||
TransactionIdStore(xid, &holdertag.xid);
|
TransactionIdStore(xid, &holdertag.xid);
|
||||||
|
|
||||||
holderTable = lockMethodTable->holderHash;
|
holderTable = lockMethodTable->holderHash;
|
||||||
holder = (PROCLOCK *) hash_search(holderTable, (Pointer) &holdertag,
|
holder = (HOLDER *) hash_search(holderTable, (Pointer) &holdertag,
|
||||||
HASH_FIND_SAVE, &found);
|
HASH_FIND_SAVE, &found);
|
||||||
if (!holder || !found)
|
if (!holder || !found)
|
||||||
{
|
{
|
||||||
@ -1064,7 +1064,7 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
elog(NOTICE, "LockRelease: holder table corrupted");
|
elog(NOTICE, "LockRelease: holder table corrupted");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
PROCLOCK_PRINT("LockRelease: found", holder);
|
HOLDER_PRINT("LockRelease: found", holder);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check that we are actually holding a lock of the type we want to
|
* Check that we are actually holding a lock of the type we want to
|
||||||
@ -1072,7 +1072,7 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
*/
|
*/
|
||||||
if (!(holder->holding[lockmode] > 0))
|
if (!(holder->holding[lockmode] > 0))
|
||||||
{
|
{
|
||||||
PROCLOCK_PRINT("LockRelease: WRONGTYPE", holder);
|
HOLDER_PRINT("LockRelease: WRONGTYPE", holder);
|
||||||
Assert(holder->holding[lockmode] >= 0);
|
Assert(holder->holding[lockmode] >= 0);
|
||||||
LWLockRelease(masterLock);
|
LWLockRelease(masterLock);
|
||||||
elog(NOTICE, "LockRelease: you don't own a lock of type %s",
|
elog(NOTICE, "LockRelease: you don't own a lock of type %s",
|
||||||
@ -1141,7 +1141,7 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
*/
|
*/
|
||||||
holder->holding[lockmode]--;
|
holder->holding[lockmode]--;
|
||||||
holder->nHolding--;
|
holder->nHolding--;
|
||||||
PROCLOCK_PRINT("LockRelease: updated", holder);
|
HOLDER_PRINT("LockRelease: updated", holder);
|
||||||
Assert((holder->nHolding >= 0) && (holder->holding[lockmode] >= 0));
|
Assert((holder->nHolding >= 0) && (holder->holding[lockmode] >= 0));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1150,10 +1150,10 @@ LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
|
|||||||
*/
|
*/
|
||||||
if (holder->nHolding == 0)
|
if (holder->nHolding == 0)
|
||||||
{
|
{
|
||||||
PROCLOCK_PRINT("LockRelease: deleting", holder);
|
HOLDER_PRINT("LockRelease: deleting", holder);
|
||||||
SHMQueueDelete(&holder->lockLink);
|
SHMQueueDelete(&holder->lockLink);
|
||||||
SHMQueueDelete(&holder->procLink);
|
SHMQueueDelete(&holder->procLink);
|
||||||
holder = (PROCLOCK *) hash_search(holderTable, (Pointer) &holder,
|
holder = (HOLDER *) hash_search(holderTable, (Pointer) &holder,
|
||||||
HASH_REMOVE_SAVED, &found);
|
HASH_REMOVE_SAVED, &found);
|
||||||
if (!holder || !found)
|
if (!holder || !found)
|
||||||
{
|
{
|
||||||
@ -1189,8 +1189,8 @@ LockReleaseAll(LOCKMETHOD lockmethod, PROC *proc,
|
|||||||
bool allxids, TransactionId xid)
|
bool allxids, TransactionId xid)
|
||||||
{
|
{
|
||||||
SHM_QUEUE *procHolders = &(proc->procHolders);
|
SHM_QUEUE *procHolders = &(proc->procHolders);
|
||||||
PROCLOCK *holder;
|
HOLDER *holder;
|
||||||
PROCLOCK *nextHolder;
|
HOLDER *nextHolder;
|
||||||
LWLockId masterLock;
|
LWLockId masterLock;
|
||||||
LOCKMETHODTABLE *lockMethodTable;
|
LOCKMETHODTABLE *lockMethodTable;
|
||||||
int i,
|
int i,
|
||||||
@ -1217,16 +1217,16 @@ LockReleaseAll(LOCKMETHOD lockmethod, PROC *proc,
|
|||||||
|
|
||||||
LWLockAcquire(masterLock, LW_EXCLUSIVE);
|
LWLockAcquire(masterLock, LW_EXCLUSIVE);
|
||||||
|
|
||||||
holder = (PROCLOCK *) SHMQueueNext(procHolders, procHolders,
|
holder = (HOLDER *) SHMQueueNext(procHolders, procHolders,
|
||||||
offsetof(PROCLOCK, procLink));
|
offsetof(HOLDER, procLink));
|
||||||
|
|
||||||
while (holder)
|
while (holder)
|
||||||
{
|
{
|
||||||
bool wakeupNeeded = false;
|
bool wakeupNeeded = false;
|
||||||
|
|
||||||
/* Get link first, since we may unlink/delete this holder */
|
/* Get link first, since we may unlink/delete this holder */
|
||||||
nextHolder = (PROCLOCK *) SHMQueueNext(procHolders, &holder->procLink,
|
nextHolder = (HOLDER *) SHMQueueNext(procHolders, &holder->procLink,
|
||||||
offsetof(PROCLOCK, procLink));
|
offsetof(HOLDER, procLink));
|
||||||
|
|
||||||
Assert(holder->tag.proc == MAKE_OFFSET(proc));
|
Assert(holder->tag.proc == MAKE_OFFSET(proc));
|
||||||
|
|
||||||
@ -1240,7 +1240,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, PROC *proc,
|
|||||||
if (!allxids && !TransactionIdEquals(xid, holder->tag.xid))
|
if (!allxids && !TransactionIdEquals(xid, holder->tag.xid))
|
||||||
goto next_item;
|
goto next_item;
|
||||||
|
|
||||||
PROCLOCK_PRINT("LockReleaseAll", holder);
|
HOLDER_PRINT("LockReleaseAll", holder);
|
||||||
LOCK_PRINT("LockReleaseAll", lock, 0);
|
LOCK_PRINT("LockReleaseAll", lock, 0);
|
||||||
Assert(lock->nRequested >= 0);
|
Assert(lock->nRequested >= 0);
|
||||||
Assert(lock->nGranted >= 0);
|
Assert(lock->nGranted >= 0);
|
||||||
@ -1294,7 +1294,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, PROC *proc,
|
|||||||
}
|
}
|
||||||
LOCK_PRINT("LockReleaseAll: updated", lock, 0);
|
LOCK_PRINT("LockReleaseAll: updated", lock, 0);
|
||||||
|
|
||||||
PROCLOCK_PRINT("LockReleaseAll: deleting", holder);
|
HOLDER_PRINT("LockReleaseAll: deleting", holder);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove the holder entry from the linked lists
|
* Remove the holder entry from the linked lists
|
||||||
@ -1305,7 +1305,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, PROC *proc,
|
|||||||
/*
|
/*
|
||||||
* remove the holder entry from the hashtable
|
* remove the holder entry from the hashtable
|
||||||
*/
|
*/
|
||||||
holder = (PROCLOCK *) hash_search(lockMethodTable->holderHash,
|
holder = (HOLDER *) hash_search(lockMethodTable->holderHash,
|
||||||
(Pointer) holder,
|
(Pointer) holder,
|
||||||
HASH_REMOVE,
|
HASH_REMOVE,
|
||||||
&found);
|
&found);
|
||||||
@ -1370,8 +1370,8 @@ LockShmemSize(int maxBackends)
|
|||||||
|
|
||||||
/* holderHash table */
|
/* holderHash table */
|
||||||
size += hash_estimate_size(max_table_size,
|
size += hash_estimate_size(max_table_size,
|
||||||
SHMEM_PROCLOCKTAB_KEYSIZE,
|
SHMEM_HOLDERTAB_KEYSIZE,
|
||||||
SHMEM_PROCLOCKTAB_DATASIZE);
|
SHMEM_HOLDERTAB_DATASIZE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since the lockHash entry count above is only an estimate, add 10%
|
* Since the lockHash entry count above is only an estimate, add 10%
|
||||||
@ -1394,7 +1394,7 @@ DumpLocks(void)
|
|||||||
{
|
{
|
||||||
PROC *proc;
|
PROC *proc;
|
||||||
SHM_QUEUE *procHolders;
|
SHM_QUEUE *procHolders;
|
||||||
PROCLOCK *holder;
|
HOLDER *holder;
|
||||||
LOCK *lock;
|
LOCK *lock;
|
||||||
int lockmethod = DEFAULT_LOCKMETHOD;
|
int lockmethod = DEFAULT_LOCKMETHOD;
|
||||||
LOCKMETHODTABLE *lockMethodTable;
|
LOCKMETHODTABLE *lockMethodTable;
|
||||||
@ -1413,8 +1413,8 @@ DumpLocks(void)
|
|||||||
if (proc->waitLock)
|
if (proc->waitLock)
|
||||||
LOCK_PRINT("DumpLocks: waiting on", proc->waitLock, 0);
|
LOCK_PRINT("DumpLocks: waiting on", proc->waitLock, 0);
|
||||||
|
|
||||||
holder = (PROCLOCK *) SHMQueueNext(procHolders, procHolders,
|
holder = (HOLDER *) SHMQueueNext(procHolders, procHolders,
|
||||||
offsetof(PROCLOCK, procLink));
|
offsetof(HOLDER, procLink));
|
||||||
|
|
||||||
while (holder)
|
while (holder)
|
||||||
{
|
{
|
||||||
@ -1422,11 +1422,11 @@ DumpLocks(void)
|
|||||||
|
|
||||||
lock = (LOCK *) MAKE_PTR(holder->tag.lock);
|
lock = (LOCK *) MAKE_PTR(holder->tag.lock);
|
||||||
|
|
||||||
PROCLOCK_PRINT("DumpLocks", holder);
|
HOLDER_PRINT("DumpLocks", holder);
|
||||||
LOCK_PRINT("DumpLocks", lock, 0);
|
LOCK_PRINT("DumpLocks", lock, 0);
|
||||||
|
|
||||||
holder = (PROCLOCK *) SHMQueueNext(procHolders, &holder->procLink,
|
holder = (HOLDER *) SHMQueueNext(procHolders, &holder->procLink,
|
||||||
offsetof(PROCLOCK, procLink));
|
offsetof(HOLDER, procLink));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1437,7 +1437,7 @@ void
|
|||||||
DumpAllLocks(void)
|
DumpAllLocks(void)
|
||||||
{
|
{
|
||||||
PROC *proc;
|
PROC *proc;
|
||||||
PROCLOCK *holder = NULL;
|
HOLDER *holder = NULL;
|
||||||
LOCK *lock;
|
LOCK *lock;
|
||||||
int lockmethod = DEFAULT_LOCKMETHOD;
|
int lockmethod = DEFAULT_LOCKMETHOD;
|
||||||
LOCKMETHODTABLE *lockMethodTable;
|
LOCKMETHODTABLE *lockMethodTable;
|
||||||
@ -1459,10 +1459,10 @@ DumpAllLocks(void)
|
|||||||
LOCK_PRINT("DumpAllLocks: waiting on", proc->waitLock, 0);
|
LOCK_PRINT("DumpAllLocks: waiting on", proc->waitLock, 0);
|
||||||
|
|
||||||
hash_seq_init(&status, holderTable);
|
hash_seq_init(&status, holderTable);
|
||||||
while ((holder = (PROCLOCK *) hash_seq_search(&status)) &&
|
while ((holder = (HOLDER *) hash_seq_search(&status)) &&
|
||||||
(holder != (PROCLOCK *) TRUE))
|
(holder != (HOLDER *) TRUE))
|
||||||
{
|
{
|
||||||
PROCLOCK_PRINT("DumpAllLocks", holder);
|
HOLDER_PRINT("DumpAllLocks", holder);
|
||||||
|
|
||||||
if (holder->tag.lock)
|
if (holder->tag.lock)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.110 2001/09/29 21:35:14 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.111 2001/09/30 00:45:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -563,7 +563,7 @@ int
|
|||||||
ProcSleep(LOCKMETHODTABLE *lockMethodTable,
|
ProcSleep(LOCKMETHODTABLE *lockMethodTable,
|
||||||
LOCKMODE lockmode,
|
LOCKMODE lockmode,
|
||||||
LOCK *lock,
|
LOCK *lock,
|
||||||
PROCLOCK *holder)
|
HOLDER *holder)
|
||||||
{
|
{
|
||||||
LOCKMETHODCTL *lockctl = lockMethodTable->ctl;
|
LOCKMETHODCTL *lockctl = lockMethodTable->ctl;
|
||||||
LWLockId masterLock = lockctl->masterLock;
|
LWLockId masterLock = lockctl->masterLock;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: lock.h,v 1.54 2001/09/29 21:35:14 momjian Exp $
|
* $Id: lock.h,v 1.55 2001/09/30 00:45:48 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -144,7 +144,7 @@ typedef struct LOCKTAG
|
|||||||
* tag -- uniquely identifies the object being locked
|
* tag -- uniquely identifies the object being locked
|
||||||
* grantMask -- bitmask for all lock types currently granted on this object.
|
* grantMask -- bitmask for all lock types currently granted on this object.
|
||||||
* waitMask -- bitmask for all lock types currently awaited on this object.
|
* waitMask -- bitmask for all lock types currently awaited on this object.
|
||||||
* lockHolders -- list of PROCLOCK objects for this lock.
|
* lockHolders -- list of HOLDER objects for this lock.
|
||||||
* waitProcs -- queue of processes waiting for this lock.
|
* waitProcs -- queue of processes waiting for this lock.
|
||||||
* requested -- count of each lock type currently requested on the lock
|
* requested -- count of each lock type currently requested on the lock
|
||||||
* (includes requests already granted!!).
|
* (includes requests already granted!!).
|
||||||
@ -160,7 +160,7 @@ typedef struct LOCK
|
|||||||
/* data */
|
/* data */
|
||||||
int grantMask; /* bitmask for lock types already granted */
|
int grantMask; /* bitmask for lock types already granted */
|
||||||
int waitMask; /* bitmask for lock types awaited */
|
int waitMask; /* bitmask for lock types awaited */
|
||||||
SHM_QUEUE lockHolders; /* list of PROCLOCK objects assoc. with lock */
|
SHM_QUEUE lockHolders; /* list of HOLDER objects assoc. with lock */
|
||||||
PROC_QUEUE waitProcs; /* list of PROC objects waiting on lock */
|
PROC_QUEUE waitProcs; /* list of PROC objects waiting on lock */
|
||||||
int requested[MAX_LOCKMODES]; /* counts of requested
|
int requested[MAX_LOCKMODES]; /* counts of requested
|
||||||
* locks */
|
* locks */
|
||||||
@ -180,8 +180,8 @@ typedef struct LOCK
|
|||||||
* on the same lockable object. We need to store some per-holder information
|
* on the same lockable object. We need to store some per-holder information
|
||||||
* for each such holder (or would-be holder).
|
* for each such holder (or would-be holder).
|
||||||
*
|
*
|
||||||
* PROCLOCKTAG is the key information needed to look up a PROCLOCK item in the
|
* HOLDERTAG is the key information needed to look up a HOLDER item in the
|
||||||
* holder hashtable. A PROCLOCKTAG value uniquely identifies a lock holder.
|
* holder hashtable. A HOLDERTAG value uniquely identifies a lock holder.
|
||||||
*
|
*
|
||||||
* There are two possible kinds of holder tags: a transaction (identified
|
* There are two possible kinds of holder tags: a transaction (identified
|
||||||
* both by the PROC of the backend running it, and the xact's own ID) and
|
* both by the PROC of the backend running it, and the xact's own ID) and
|
||||||
@ -197,35 +197,35 @@ typedef struct LOCK
|
|||||||
* Otherwise, holder objects whose counts have gone to zero are recycled
|
* Otherwise, holder objects whose counts have gone to zero are recycled
|
||||||
* as soon as convenient.
|
* as soon as convenient.
|
||||||
*
|
*
|
||||||
* Each PROCLOCK object is linked into lists for both the associated LOCK object
|
* Each HOLDER object is linked into lists for both the associated LOCK object
|
||||||
* and the owning PROC object. Note that the PROCLOCK is entered into these
|
* and the owning PROC object. Note that the HOLDER is entered into these
|
||||||
* lists as soon as it is created, even if no lock has yet been granted.
|
* lists as soon as it is created, even if no lock has yet been granted.
|
||||||
* A PROC that is waiting for a lock to be granted will also be linked into
|
* A PROC that is waiting for a lock to be granted will also be linked into
|
||||||
* the lock's waitProcs queue.
|
* the lock's waitProcs queue.
|
||||||
*/
|
*/
|
||||||
typedef struct PROCLOCKTAG
|
typedef struct HOLDERTAG
|
||||||
{
|
{
|
||||||
SHMEM_OFFSET lock; /* link to per-lockable-object information */
|
SHMEM_OFFSET lock; /* link to per-lockable-object information */
|
||||||
SHMEM_OFFSET proc; /* link to PROC of owning backend */
|
SHMEM_OFFSET proc; /* link to PROC of owning backend */
|
||||||
TransactionId xid; /* xact ID, or InvalidTransactionId */
|
TransactionId xid; /* xact ID, or InvalidTransactionId */
|
||||||
} PROCLOCKTAG;
|
} HOLDERTAG;
|
||||||
|
|
||||||
typedef struct PROCLOCK
|
typedef struct HOLDER
|
||||||
{
|
{
|
||||||
/* tag */
|
/* tag */
|
||||||
PROCLOCKTAG tag; /* unique identifier of holder object */
|
HOLDERTAG tag; /* unique identifier of holder object */
|
||||||
|
|
||||||
/* data */
|
/* data */
|
||||||
int holding[MAX_LOCKMODES]; /* count of locks currently held */
|
int holding[MAX_LOCKMODES]; /* count of locks currently held */
|
||||||
int nHolding; /* total of holding[] array */
|
int nHolding; /* total of holding[] array */
|
||||||
SHM_QUEUE lockLink; /* list link for lock's list of holders */
|
SHM_QUEUE lockLink; /* list link for lock's list of holders */
|
||||||
SHM_QUEUE procLink; /* list link for process's list of holders */
|
SHM_QUEUE procLink; /* list link for process's list of holders */
|
||||||
} PROCLOCK;
|
} HOLDER;
|
||||||
|
|
||||||
#define SHMEM_PROCLOCKTAB_KEYSIZE sizeof(PROCLOCKTAG)
|
#define SHMEM_HOLDERTAB_KEYSIZE sizeof(HOLDERTAG)
|
||||||
#define SHMEM_PROCLOCKTAB_DATASIZE (sizeof(PROCLOCK) - SHMEM_PROCLOCKTAB_KEYSIZE)
|
#define SHMEM_HOLDERTAB_DATASIZE (sizeof(HOLDER) - SHMEM_HOLDERTAB_KEYSIZE)
|
||||||
|
|
||||||
#define PROCLOCK_LOCKMETHOD(holder) \
|
#define HOLDER_LOCKMETHOD(holder) \
|
||||||
(((LOCK *) MAKE_PTR((holder).tag.lock))->tag.lockmethod)
|
(((LOCK *) MAKE_PTR((holder).tag.lock))->tag.lockmethod)
|
||||||
|
|
||||||
|
|
||||||
@ -245,9 +245,9 @@ extern bool LockReleaseAll(LOCKMETHOD lockmethod, PROC *proc,
|
|||||||
bool allxids, TransactionId xid);
|
bool allxids, TransactionId xid);
|
||||||
extern int LockCheckConflicts(LOCKMETHODTABLE *lockMethodTable,
|
extern int LockCheckConflicts(LOCKMETHODTABLE *lockMethodTable,
|
||||||
LOCKMODE lockmode,
|
LOCKMODE lockmode,
|
||||||
LOCK *lock, PROCLOCK *holder, PROC *proc,
|
LOCK *lock, HOLDER *holder, PROC *proc,
|
||||||
int *myHolding);
|
int *myHolding);
|
||||||
extern void GrantLock(LOCK *lock, PROCLOCK *holder, LOCKMODE lockmode);
|
extern void GrantLock(LOCK *lock, HOLDER *holder, LOCKMODE lockmode);
|
||||||
extern void RemoveFromWaitQueue(PROC *proc);
|
extern void RemoveFromWaitQueue(PROC *proc);
|
||||||
extern int LockShmemSize(int maxBackends);
|
extern int LockShmemSize(int maxBackends);
|
||||||
extern bool DeadLockCheck(PROC *proc);
|
extern bool DeadLockCheck(PROC *proc);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: proc.h,v 1.49 2001/09/29 21:35:14 momjian Exp $
|
* $Id: proc.h,v 1.50 2001/09/30 00:45:48 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -67,12 +67,12 @@ struct PROC
|
|||||||
/* Info about lock the process is currently waiting for, if any. */
|
/* Info about lock the process is currently waiting for, if any. */
|
||||||
/* waitLock and waitHolder are NULL if not currently waiting. */
|
/* waitLock and waitHolder are NULL if not currently waiting. */
|
||||||
LOCK *waitLock; /* Lock object we're sleeping on ... */
|
LOCK *waitLock; /* Lock object we're sleeping on ... */
|
||||||
PROCLOCK *waitHolder; /* Per-holder info for awaited lock */
|
HOLDER *waitHolder; /* Per-holder info for awaited lock */
|
||||||
LOCKMODE waitLockMode; /* type of lock we're waiting for */
|
LOCKMODE waitLockMode; /* type of lock we're waiting for */
|
||||||
LOCKMASK heldLocks; /* bitmask for lock types already held on
|
LOCKMASK heldLocks; /* bitmask for lock types already held on
|
||||||
* this lock object by this backend */
|
* this lock object by this backend */
|
||||||
|
|
||||||
SHM_QUEUE procHolders; /* list of PROCLOCK objects for locks held
|
SHM_QUEUE procHolders; /* list of HOLDER objects for locks held
|
||||||
* or awaited by this backend */
|
* or awaited by this backend */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ extern void ProcReleaseLocks(bool isCommit);
|
|||||||
|
|
||||||
extern void ProcQueueInit(PROC_QUEUE *queue);
|
extern void ProcQueueInit(PROC_QUEUE *queue);
|
||||||
extern int ProcSleep(LOCKMETHODTABLE *lockMethodTable, LOCKMODE lockmode,
|
extern int ProcSleep(LOCKMETHODTABLE *lockMethodTable, LOCKMODE lockmode,
|
||||||
LOCK *lock, PROCLOCK *holder);
|
LOCK *lock, HOLDER *holder);
|
||||||
extern PROC *ProcWakeup(PROC *proc, int errType);
|
extern PROC *ProcWakeup(PROC *proc, int errType);
|
||||||
extern void ProcLockWakeup(LOCKMETHODTABLE *lockMethodTable, LOCK *lock);
|
extern void ProcLockWakeup(LOCKMETHODTABLE *lockMethodTable, LOCK *lock);
|
||||||
extern bool LockWaitCancel(void);
|
extern bool LockWaitCancel(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user