|
PostgreSQL Source Code git master
|
#include "access/transam.h"#include "lib/ilist.h"#include "storage/lockdefs.h"#include "storage/lwlock.h"#include "storage/procnumber.h"#include "storage/shmem.h"#include "utils/timestamp.h"

Go to the source code of this file.
Data Structures | |
| struct | VirtualTransactionId |
| struct | LockMethodData |
| struct | LOCKTAG |
| struct | LOCK |
| struct | PROCLOCKTAG |
| struct | PROCLOCK |
| struct | LOCALLOCKTAG |
| struct | LOCALLOCKOWNER |
| struct | LOCALLOCK |
| struct | LockInstanceData |
| struct | LockData |
| struct | BlockedProcData |
| struct | BlockedProcsData |
Variables | |
| PGDLLIMPORT int | max_locks_per_xact |
| PGDLLIMPORT bool | log_lock_failures |
| PGDLLIMPORT const char *const | LockTagTypeNames [] |
Definition at line 79 of file lock.h.
| #define LOCALLOCK_LOCKTAG | ( | llock | ) | ((LockTagType) (llock).tag.lock.locktag_type) |
| #define LocalTransactionIdIsValid | ( | lxid | ) | ((lxid) != InvalidLocalTransactionId) |
| #define LOCK_LOCKMETHOD | ( | lock | ) | ((LOCKMETHODID) (lock).tag.locktag_lockmethodid) |
| #define LOCK_LOCKTAG | ( | lock | ) | ((LockTagType) (lock).tag.locktag_type) |
| #define LockHashPartition | ( | hashcode | ) | ((hashcode) % NUM_LOCK_PARTITIONS) |
| #define LockHashPartitionLock | ( | hashcode | ) |
| #define LockHashPartitionLockByIndex | ( | i | ) | (&MainLWLockArray[LOCK_MANAGER_LWLOCK_OFFSET + (i)].lock) |
| #define LockHashPartitionLockByProc | ( | leader_pgproc | ) | LockHashPartitionLock(GetNumberFromPGProc(leader_pgproc)) |
| #define LOCKTAG_LAST_TYPE LOCKTAG_APPLY_TRANSACTION |
| #define PROCLOCK_LOCKMETHOD | ( | proclock | ) | LOCK_LOCKMETHOD(*((proclock).tag.myLock)) |
| #define SET_LOCKTAG_DATABASE_FROZEN_IDS | ( | locktag, | |
| dboid | |||
| ) |
| #define SET_LOCKTAG_OBJECT | ( | locktag, | |
| dboid, | |||
| classoid, | |||
| objoid, | |||
| objsubid | |||
| ) |
| #define SET_LOCKTAG_PAGE | ( | locktag, | |
| dboid, | |||
| reloid, | |||
| blocknum | |||
| ) |
| #define SET_LOCKTAG_RELATION | ( | locktag, | |
| dboid, | |||
| reloid | |||
| ) |
| #define SET_LOCKTAG_RELATION_EXTEND | ( | locktag, | |
| dboid, | |||
| reloid | |||
| ) |
| #define SET_LOCKTAG_TRANSACTION | ( | locktag, | |
| xid | |||
| ) |
| #define SET_LOCKTAG_TUPLE | ( | locktag, | |
| dboid, | |||
| reloid, | |||
| blocknum, | |||
| offnum | |||
| ) |
| #define SET_LOCKTAG_VIRTUALTRANSACTION | ( | locktag, | |
| vxid | |||
| ) |
| #define SetInvalidVirtualTransactionId | ( | vxid | ) |
| #define VirtualTransactionIdIsRecoveredPreparedXact | ( | vxid | ) | ((vxid).procNumber == INVALID_PROC_NUMBER) |
| #define VirtualTransactionIdIsValid | ( | vxid | ) | (LocalTransactionIdIsValid((vxid).localTransactionId)) |
| Enumerator | |
|---|---|
| DS_NOT_YET_CHECKED | |
| DS_NO_DEADLOCK | |
| DS_SOFT_DEADLOCK | |
| DS_HARD_DEADLOCK | |
| DS_BLOCKED_BY_AUTOVACUUM | |
| Enumerator | |
|---|---|
| LOCKACQUIRE_NOT_AVAIL | |
| LOCKACQUIRE_OK | |
| LOCKACQUIRE_ALREADY_HELD | |
| LOCKACQUIRE_ALREADY_CLEAR | |
Definition at line 501 of file lock.h.
Definition at line 1860 of file lock.c.
References Assert, FastPathStrongRelationLockData::count, FastPathStrongLockHashPartition, FastPathStrongRelationLocks, fb(), FastPathStrongRelationLockData::mutex, SpinLockAcquire, SpinLockRelease, and StrongLockInProgress.
Referenced by LockAcquireExtended(), and LockErrorCleanup().
Definition at line 3476 of file lock.c.
References CheckForSessionAndXactLocks(), ereport, errcode(), errmsg(), ERROR, FastPathGetRelationLockEntry(), fb(), hash_seq_init(), hash_seq_search(), i, LockMethodLocalHash, TwoPhaseLockRecord::lockmode, TwoPhaseLockRecord::locktag, LOCKTAG_VIRTUALTRANSACTION, RegisterTwoPhaseRecord(), and TWOPHASE_RM_LOCK_ID.
Referenced by PrepareTransaction().
|
extern |
Definition at line 220 of file deadlock.c.
References Assert, blocking_autovacuum_proc, dclist_count(), dclist_init(), dclist_push_tail(), DeadLockCheckRecurse(), DS_BLOCKED_BY_AUTOVACUUM, DS_HARD_DEADLOCK, DS_NO_DEADLOCK, DS_SOFT_DEADLOCK, elog, FATAL, fb(), FindLockCycle(), GetLocksMethodTable(), i, j, links, WAIT_ORDER::lock, nCurConstraints, nPossibleConstraints, WAIT_ORDER::nProcs, nWaitOrders, possibleConstraints, ProcLockWakeup(), WAIT_ORDER::procs, waitOrders, and LOCK::waitProcs.
Referenced by CheckDeadLock().
|
extern |
Definition at line 1075 of file deadlock.c.
References _, appendBinaryStringInfo(), appendStringInfo(), appendStringInfoChar(), deadlockDetails, DescribeLockTag(), ereport, errcode(), ERRCODE_T_R_DEADLOCK_DETECTED, errdetail_internal(), errdetail_log(), errhint(), errmsg(), ERROR, fb(), GetLockmodeName(), i, initStringInfo(), DEADLOCK_INFO::lockmode, DEADLOCK_INFO::locktag, LOCKTAG::locktag_lockmethodid, nDeadlockDetails, pgstat_get_backend_current_activity(), pgstat_report_deadlock(), DEADLOCK_INFO::pid, and resetStringInfo().
Referenced by LockAcquireExtended().
Definition at line 623 of file lock.c.
References DEFAULT_LOCKMETHOD, fb(), LOCKBIT_ON, and LockMethods.
Referenced by Do_MultiXactIdWait(), DoesMultiXactIdConflict(), initialize_reloptions(), and test_lockmode_for_conflict().
Definition at line 1898 of file lock.c.
References awaitedLock.
Referenced by LockErrorCleanup(), ProcessRecoveryConflictInterrupt(), and ProcSleep().
|
extern |
Definition at line 3996 of file lock.c.
References Assert, BackendPidGetProcWithLock(), dlist_iter::cur, data, dlist_container, dlist_foreach, fb(), GetSingleProcBlockerStatusData(), i, PGPROC::lockGroupLeader, PGPROC::lockGroupMembers, LockHashPartitionLockByIndex, LW_SHARED, LWLockAcquire(), LWLockRelease(), MaxBackends, NUM_LOCK_PARTITIONS, palloc_array, and palloc_object.
Referenced by pg_blocking_pids().
Definition at line 290 of file deadlock.c.
References blocking_autovacuum_proc, and fb().
Referenced by ProcSleep().
|
extern |
Definition at line 3069 of file lock.c.
References PROC_HDR::allProcCount, ConflictsWithRelationFastPath, PGPROC::databaseId, dlist_container, dlist_foreach, elog, ERROR, FAST_PATH_GET_BITS, FAST_PATH_LOCKNUMBER_OFFSET, FAST_PATH_REL_GROUP, FAST_PATH_SLOT, fb(), FP_LOCK_SLOTS_PER_GROUP, PGPROC::fpInfoLock, PGPROC::fpLockBits, PGPROC::fpRelId, GET_VXID_FROM_PGPROC, GetPGProcByNumber, HASH_FIND, hash_search_with_hash_value(), PROCLOCK::holdMask, i, InHotStandby, INVALID_PROC_NUMBER, InvalidLocalTransactionId, j, lengthof, LockHashPartitionLock, LockMethodLockHash, LockMethods, LOCKTAG::locktag_field1, LOCKTAG::locktag_field2, LOCKTAG::locktag_lockmethodid, LockTagHashCode(), LW_SHARED, LWLockAcquire(), LWLockRelease(), max_prepared_xacts, MaxBackends, MemoryContextAlloc(), MyProc, PROCLOCKTAG::myProc, palloc0_array, PANIC, ProcGlobal, LOCK::procLocks, PROCLOCK::tag, TopMemoryContext, VirtualTransactionIdEquals, and VirtualTransactionIdIsValid.
Referenced by ProcSleep(), ResolveRecoveryConflictWithLock(), and WaitForLockersMultiple().
|
extern |
Definition at line 4253 of file lock.c.
References Assert, fb(), lengthof, LockMethods, LockMethodData::lockModeNames, and mode.
Referenced by DeadLockReport(), LockAcquireExtended(), overexplain_range_table(), pg_lock_status(), ProcSleep(), and waitonlock_error_callback().
|
extern |
Definition at line 527 of file lock.c.
References Assert, fb(), lengthof, LOCK_LOCKMETHOD, and LockMethods.
Referenced by DeadLockCheck(), and FindLockCycleRecurseMember().
Definition at line 3793 of file lock.c.
References PROC_HDR::allProcCount, Assert, data, PGPROC::databaseId, ExclusiveLock, FAST_PATH_GET_BITS, FAST_PATH_LOCKNUMBER_OFFSET, FAST_PATH_SLOT, FastPathLockGroupsPerBackend, fb(), FP_LOCK_SLOTS_PER_GROUP, PGPROC::fpInfoLock, PGPROC::fpLocalTransactionId, PGPROC::fpLockBits, PGPROC::fpRelId, PGPROC::fpVXIDLock, GetPGProcByNumber, PROCLOCK::groupLeader, hash_get_num_entries(), hash_seq_init(), hash_seq_search(), PROCLOCK::holdMask, i, j, VirtualTransactionId::localTransactionId, LOCKBIT_ON, LockHashPartitionLockByIndex, LockMethodProcLockHash, LW_SHARED, LWLockAcquire(), LWLockRelease(), PGPROC::lxid, MaxBackends, PROCLOCKTAG::myLock, PROCLOCKTAG::myProc, NoLock, NUM_LOCK_PARTITIONS, palloc_array, palloc_object, pg_atomic_read_u64(), PGPROC::pid, ProcGlobal, VirtualTransactionId::procNumber, PGPROC::procNumber, repalloc(), SET_LOCKTAG_RELATION, SET_LOCKTAG_VIRTUALTRANSACTION, LOCK::tag, PROCLOCK::tag, PGPROC::vxid, PGPROC::waitLock, PGPROC::waitLockMode, and PGPROC::waitStart.
Referenced by pg_lock_status().
|
extern |
Definition at line 539 of file lock.c.
References Assert, fb(), lengthof, LockMethods, and LOCKTAG::locktag_lockmethodid.
Referenced by pg_blocking_pids().
|
extern |
Definition at line 4171 of file lock.c.
References AccessExclusiveLock, Assert, fb(), hash_get_num_entries(), hash_seq_init(), hash_seq_search(), PROCLOCK::holdMask, i, LOCKBIT_ON, LockHashPartitionLockByIndex, LockMethodProcLockHash, LOCKTAG::locktag_field1, LOCKTAG::locktag_field2, LOCKTAG_RELATION, LOCKTAG::locktag_type, LW_SHARED, LWLockAcquire(), LWLockRelease(), PROCLOCKTAG::myLock, PROCLOCKTAG::myProc, NUM_LOCK_PARTITIONS, palloc(), LOCK::tag, PROCLOCK::tag, TransactionIdIsValid, and PGPROC::xid.
Referenced by LogStandbySnapshot().
Definition at line 1889 of file lock.c.
References awaitedLock, awaitedOwner, and GrantLockLocal().
Referenced by LockErrorCleanup().
Definition at line 1658 of file lock.c.
References Assert, LOCK::granted, LOCK::grantMask, PROCLOCK::holdMask, LOCK_PRINT, LOCKBIT_OFF, LOCKBIT_ON, LOCK::nGranted, LOCK::nRequested, LOCK::requested, and LOCK::waitMask.
Referenced by FastPathGetRelationLockEntry(), FastPathTransferRelationLocks(), JoinWaitQueue(), lock_twophase_recover(), LockAcquireExtended(), ProcLockWakeup(), and VirtualXactLock().
Definition at line 144 of file deadlock.c.
References afterConstraints, beforeConstraints, curConstraints, deadlockDetails, fb(), MAX_BACKENDS_BITS, MaxBackends, maxCurConstraints, maxPossibleConstraints, MemoryContextSwitchTo(), palloc(), possibleConstraints, StaticAssertStmt, TopMemoryContext, topoProcs, visitedProcs, waitOrderProcs, and waitOrders.
Referenced by InitProcess().
Definition at line 505 of file lock.c.
References HASHCTL::entrysize, HASH_BLOBS, hash_create(), HASH_ELEM, HASHCTL::keysize, and LockMethodLocalHash.
Referenced by BaseInit().
|
extern |
Definition at line 4596 of file lock.c.
References fb(), len, and lock_twophase_postcommit().
|
extern |
Definition at line 4570 of file lock.c.
References Assert, elog, ERROR, fb(), len, lengthof, LockMethods, TwoPhaseLockRecord::lockmode, LockRefindAndRelease(), TwoPhaseLockRecord::locktag, LOCKTAG::locktag_lockmethodid, and TwoPhaseGetDummyProc().
Referenced by lock_twophase_postabort().
|
extern |
Definition at line 4357 of file lock.c.
References Assert, ConflictsWithRelationFastPath, FastPathStrongRelationLockData::count, dclist_init(), dlist_init(), dlist_is_empty(), dlist_push_tail(), elog, ereport, errcode(), errhint(), errmsg(), ERROR, FastPathStrongLockHashPartition, FastPathStrongRelationLocks, fb(), LOCK::granted, GrantLock(), LOCK::grantMask, PROCLOCK::groupLeader, HASH_ENTER_NULL, HASH_REMOVE, hash_search_with_hash_value(), PROCLOCK::holdMask, len, lengthof, LOCK_PRINT, LOCKBIT_ON, PGPROC::lockGroupLeader, LockHashPartition, LockHashPartitionLock, PROCLOCK::lockLink, LockMethodLockHash, LockMethodProcLockHash, LockMethods, TwoPhaseLockRecord::lockmode, TwoPhaseLockRecord::locktag, LOCKTAG::locktag_field1, LOCKTAG::locktag_field2, LOCKTAG::locktag_field3, LOCKTAG::locktag_lockmethodid, LockTagHashCode(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MAX_LOCKMODES, MemSet, FastPathStrongRelationLockData::mutex, PGPROC::myProcLocks, LOCK::nGranted, LOCK::nRequested, PANIC, PROCLOCK::procLink, PROCLOCK_PRINT, ProcLockHashCode(), LOCK::procLocks, PROCLOCK::releaseMask, LOCK::requested, SpinLockAcquire, SpinLockRelease, LOCK::tag, TwoPhaseGetDummyProc(), LOCK::waitMask, and LOCK::waitProcs.
|
extern |
Definition at line 4538 of file lock.c.
References AccessExclusiveLock, Assert, elog, ERROR, fb(), len, lengthof, LockMethods, TwoPhaseLockRecord::lockmode, TwoPhaseLockRecord::locktag, LOCKTAG::locktag_field1, LOCKTAG::locktag_field2, LOCKTAG::locktag_lockmethodid, LOCKTAG_RELATION, LOCKTAG::locktag_type, StandbyAcquireAccessExclusiveLock(), and XidFromFullTransactionId.
|
extern |
Definition at line 809 of file lock.c.
References fb(), and LockAcquireExtended().
Referenced by ConditionalLockPage(), ConditionalLockRelationForExtension(), LockApplyTransactionForSession(), LockDatabaseFrozenIds(), LockDatabaseObject(), LockPage(), LockRelationForExtension(), LockRelationIdForSession(), LockSharedObject(), LockSharedObjectForSession(), LockTuple(), pg_advisory_lock_int4(), pg_advisory_lock_int8(), pg_advisory_lock_shared_int4(), pg_advisory_lock_shared_int8(), pg_advisory_xact_lock_int4(), pg_advisory_xact_lock_int8(), pg_advisory_xact_lock_shared_int4(), pg_advisory_xact_lock_shared_int8(), pg_try_advisory_lock_int4(), pg_try_advisory_lock_int8(), pg_try_advisory_lock_shared_int4(), pg_try_advisory_lock_shared_int8(), pg_try_advisory_xact_lock_int4(), pg_try_advisory_xact_lock_int8(), pg_try_advisory_xact_lock_shared_int4(), pg_try_advisory_xact_lock_shared_int8(), SearchSysCacheLocked1(), SpeculativeInsertionLockAcquire(), SpeculativeInsertionWait(), StandbyAcquireAccessExclusiveLock(), VirtualXactLock(), XactLockForVirtualXact(), XactLockTableInsert(), and XactLockTableWait().
|
extern |
Definition at line 836 of file lock.c.
References AbortStrongLockAcquire(), AccessExclusiveLock, Assert, BeginStrongLockAcquire(), buf, ConflictsWithRelationFastPath, FastPathStrongRelationLockData::count, CurrentResourceOwner, DeadLockReport(), DescribeLockTag(), dlist_delete(), EligibleForRelationFastPath, elog, ereport, errcode(), errdetail_log_plural(), errhint(), errmsg(), ERROR, FAST_PATH_REL_GROUP, FastPathGrantRelationLock(), FastPathLocalUseCounts, FastPathStrongLockHashPartition, FastPathStrongRelationLocks, FastPathTransferRelationLocks(), fb(), FinishStrongLockAcquire(), FP_LOCK_SLOTS_PER_GROUP, PGPROC::fpInfoLock, GetLockHoldersAndWaiters(), GetLockmodeName(), GrantLock(), GrantLockLocal(), HASH_ENTER, HASH_REMOVE, hash_search(), hash_search_with_hash_value(), PROCLOCK::holdMask, initStringInfo(), InRecovery, JoinWaitQueue(), lengthof, LOCK_PRINT, LOCKACQUIRE_ALREADY_CLEAR, LOCKACQUIRE_ALREADY_HELD, LOCKACQUIRE_NOT_AVAIL, LOCKACQUIRE_OK, LOCKBIT_ON, LockCheckConflicts(), LockHashPartitionLock, PROCLOCK::lockLink, LockMethodLocalHash, LockMethodProcLockHash, LockMethods, LOCKTAG::locktag_field1, LOCKTAG::locktag_field2, LOCKTAG::locktag_lockmethodid, LOCKTAG_OBJECT, LOCKTAG_RELATION, LOCKTAG::locktag_type, LockTagHashCode(), LOG, LogAccessExclusiveLock(), LogAccessExclusiveLockPrepare(), LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), MemoryContextAlloc(), MemSet, PROCLOCKTAG::myLock, MyProc, MyProcPid, LOCK::nGranted, LOCK::nRequested, PANIC, pfree(), PROC_WAIT_STATUS_ERROR, PROC_WAIT_STATUS_OK, PROC_WAIT_STATUS_WAITING, PROCLOCK::procLink, PROCLOCK_PRINT, ProcLockHashCode(), RecoveryInProgress(), RemoveLocalLock(), repalloc(), LOCK::requested, RowExclusiveLock, SetupLockInTable(), PROCLOCK::tag, TopMemoryContext, LOCK::waitMask, WaitOnLock(), and XLogStandbyInfoActive.
Referenced by ConditionalLockDatabaseObject(), ConditionalLockRelation(), ConditionalLockRelationOid(), ConditionalLockSharedObject(), ConditionalLockTuple(), ConditionalXactLockTableWait(), LockAcquire(), LockRelation(), LockRelationId(), and LockRelationOid().
|
extern |
Definition at line 1529 of file lock.c.
References Assert, dlist_container, dlist_foreach, elog, fb(), LOCK::granted, LOCK::grantMask, PROCLOCK::groupLeader, PROCLOCK::holdMask, i, LOCK_LOCKTAG, LOCKBIT_ON, PGPROC::lockGroupLeader, LOCKTAG_RELATION_EXTEND, MAX_LOCKMODES, MyProc, PROCLOCKTAG::myProc, PANIC, PROCLOCK_PRINT, LOCK::procLocks, and PROCLOCK::tag.
Referenced by JoinWaitQueue(), LockAcquireExtended(), and ProcLockWakeup().
Definition at line 696 of file lock.c.
References elog, ERROR, fb(), HASH_FIND, hash_search(), PROCLOCK::holdMask, lengthof, LOCK_PRINT, LOCKBIT_ON, LockHashPartitionLock, LockMethodLocalHash, LockMethods, LOCKTAG::locktag_field1, LOCKTAG::locktag_field2, LOCKTAG::locktag_lockmethodid, LOG, LW_SHARED, LWLockAcquire(), LWLockRelease(), MemSet, PROCLOCK_PRINT, RemoveLocalLock(), LOCK::waitMask, and WARNING.
Referenced by LockHasWaitersRelation().
Definition at line 643 of file lock.c.
References fb(), HASH_FIND, hash_search(), LockHeldByMe(), LockMethodLocalHash, MaxLockMode, and MemSet.
Referenced by CheckRelationLockedByMe(), CheckRelationOidLockedByMe(), LockHeldByMe(), and UpdateSubscriptionRelState().
Definition at line 444 of file lock.c.
References HASHCTL::entrysize, FastPathStrongRelationLocks, fb(), HASHCTL::hash, HASH_BLOBS, HASH_ELEM, HASH_FUNCTION, HASH_PARTITION, HASHCTL::keysize, LockMethodLockHash, LockMethodProcLockHash, FastPathStrongRelationLockData::mutex, NLOCKENTS, NUM_LOCK_PARTITIONS, HASHCTL::num_partitions, proclock_hash(), ShmemInitHash(), ShmemInitStruct(), and SpinLockInit.
Referenced by CreateOrAttachShmemStructs().
Definition at line 3756 of file lock.c.
References add_size(), fb(), hash_estimate_size(), and NLOCKENTS.
Referenced by CalculateShmemSize().
Definition at line 2706 of file lock.c.
References Assert, CurrentResourceOwner, fb(), hash_seq_init(), hash_seq_search(), i, LockMethodLocalHash, LockReassignOwner(), and ResourceOwnerGetParent().
Referenced by ResourceOwnerReleaseInternal().
Definition at line 2102 of file lock.c.
References Assert, CleanUpLock(), CurrentResourceOwner, EligibleForRelationFastPath, elog, ERROR, FAST_PATH_REL_GROUP, FastPathLocalUseCounts, FastPathUnGrantRelationLock(), fb(), PGPROC::fpInfoLock, HASH_FIND, hash_search(), hash_search_with_hash_value(), PROCLOCK::holdMask, i, lengthof, LOCK_PRINT, LOCKBIT_ON, LockHashPartitionLock, LockMethodLocalHash, LockMethodLockHash, LockMethodProcLockHash, LockMethods, LOCKTAG::locktag_field1, LOCKTAG::locktag_field2, LOCKTAG::locktag_lockmethodid, LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MemSet, MyProc, PROCLOCK_PRINT, RemoveLocalLock(), ResourceOwnerForgetLock(), UnGrantLock(), and WARNING.
Referenced by ConditionalXactLockTableWait(), pg_advisory_unlock_int4(), pg_advisory_unlock_int8(), pg_advisory_unlock_shared_int4(), pg_advisory_unlock_shared_int8(), ReleaseLockIfHeld(), SearchSysCacheLocked1(), SpeculativeInsertionLockRelease(), SpeculativeInsertionWait(), StandbyReleaseXidEntryLocks(), UnlockApplyTransactionForSession(), UnlockDatabaseObject(), UnlockPage(), UnlockRelation(), UnlockRelationForExtension(), UnlockRelationId(), UnlockRelationIdForSession(), UnlockRelationOid(), UnlockSharedObject(), UnlockSharedObjectForSession(), UnlockTuple(), VirtualXactLock(), XactLockForVirtualXact(), XactLockTableDelete(), and XactLockTableWait().
|
extern |
Definition at line 2307 of file lock.c.
References Assert, CleanUpLock(), DEFAULT_LOCKMETHOD, dlist_container, dlist_foreach_modify, dlist_is_empty(), EligibleForRelationFastPath, elog, ERROR, FastPathUnGrantRelationLock(), fb(), PGPROC::fpInfoLock, LOCK::grantMask, hash_seq_init(), hash_seq_search(), PROCLOCK::holdMask, i, lengthof, LOCALLOCK_LOCKMETHOD, LOCALLOCK_LOCKTAG, LOCK_LOCKMETHOD, LOCK_PRINT, LOCKBIT_ON, LockHashPartitionLockByIndex, LockMethodLocalHash, LockMethods, LockRefindAndRelease(), LOCKTAG_TUPLE, LockTagHashCode(), LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), PROCLOCKTAG::myLock, MyProc, PROCLOCKTAG::myProc, PGPROC::myProcLocks, LOCK::nGranted, LOCALLOCKOWNER::nLocks, LOCK::nRequested, NUM_LOCK_PARTITIONS, LOCALLOCKOWNER::owner, PANIC, PROCLOCK_PRINT, PROCLOCK::releaseMask, RemoveLocalLock(), ResourceOwnerForgetLock(), LOCK::tag, PROCLOCK::tag, UnGrantLock(), VirtualXactLockTableCleanup(), and WARNING.
Referenced by DiscardAll(), logicalrep_worker_onexit(), ProcReleaseLocks(), and ShutdownPostgres().
Definition at line 2611 of file lock.c.
References fb(), hash_seq_init(), hash_seq_search(), i, LockMethodLocalHash, and ReleaseLockIfHeld().
Referenced by ResourceOwnerReleaseInternal().
|
extern |
Definition at line 2581 of file lock.c.
References elog, ERROR, fb(), hash_seq_init(), hash_seq_search(), lengthof, LOCALLOCK_LOCKMETHOD, LockMethodLocalHash, LockMethods, and ReleaseLockIfHeld().
Referenced by pg_advisory_unlock_all().
Definition at line 557 of file lock.c.
References get_hash_value(), and LockMethodLockHash.
Referenced by CheckDeadLock(), GetLockConflicts(), lock_twophase_recover(), LockAcquireExtended(), LockRefindAndRelease(), LockReleaseAll(), LockWaiterCount(), proclock_hash(), and VirtualXactLock().
Definition at line 4854 of file lock.c.
References Assert, elog, ERROR, fb(), HASH_FIND, hash_search_with_hash_value(), lengthof, LockHashPartitionLock, LockMethodLockHash, LockMethods, LOCKTAG::locktag_lockmethodid, LockTagHashCode(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), and LOCK::nRequested.
Referenced by RelationExtensionLockWaiterCount().
Definition at line 1920 of file lock.c.
Referenced by ConditionalLockDatabaseObject(), ConditionalLockRelation(), ConditionalLockRelationOid(), ConditionalLockSharedObject(), LockRelation(), LockRelationId(), and LockRelationOid().
|
extern |
Definition at line 3572 of file lock.c.
References Assert, dlist_container, dlist_delete(), dlist_foreach_modify, dlist_is_empty(), dlist_push_tail(), elog, END_CRIT_SECTION, ereport, errcode(), errmsg(), fb(), LOCK::grantMask, PROCLOCK::groupLeader, hash_seq_init(), hash_seq_search(), hash_update_hash_key(), PROCLOCK::holdMask, i, LOCK_PRINT, LOCKBIT_ON, PGPROC::lockGroupLeader, LockHashPartitionLockByIndex, LockMethodLocalHash, LockMethodProcLockHash, LOCKTAG::locktag_type, LOCKTAG_VIRTUALTRANSACTION, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), PROCLOCKTAG::myLock, MyProc, PROCLOCKTAG::myProc, PGPROC::myProcLocks, LOCK::nGranted, LOCK::nRequested, NUM_LOCK_PARTITIONS, PANIC, PROCLOCK::procLink, PROCLOCK_PRINT, PROCLOCK::releaseMask, RemoveLocalLock(), START_CRIT_SECTION, LOCK::tag, PROCLOCK::tag, and TwoPhaseGetDummyProc().
Referenced by PrepareTransaction().
|
extern |
Definition at line 1147 of file deadlock.c.
References deadlockDetails, fb(), DEADLOCK_INFO::lockmode, DEADLOCK_INFO::locktag, nDeadlockDetails, DEADLOCK_INFO::pid, and LOCK::tag.
Referenced by JoinWaitQueue().
Definition at line 2046 of file lock.c.
References Assert, CleanUpLock(), dclist_delete_from_thoroughly(), dclist_is_empty(), fb(), LOCK::granted, lengthof, PGPROC::links, LOCK_LOCKMETHOD, LOCKBIT_OFF, LockMethods, dlist_node::next, LOCK::nGranted, LOCK::nRequested, PROC_WAIT_STATUS_ERROR, PROC_WAIT_STATUS_WAITING, LOCK::requested, PGPROC::waitLock, PGPROC::waitLockMode, LOCK::waitMask, PGPROC::waitProcLock, LOCK::waitProcs, and PGPROC::waitStatus.
Referenced by CheckDeadLock(), and LockErrorCleanup().
Definition at line 1907 of file lock.c.
References awaitedLock, and fb().
Referenced by LockErrorCleanup().
|
extern |
Definition at line 4743 of file lock.c.
References Assert, DEFAULT_LOCKMETHOD, ereport, errcode(), errhint(), errmsg(), ERROR, ExclusiveLock, fb(), PGPROC::fpInfoLock, PGPROC::fpLocalTransactionId, PGPROC::fpVXIDLock, GrantLock(), InvalidTransactionId, VirtualTransactionId::localTransactionId, LockAcquire(), LockHashPartitionLock, LockMethods, LockRelease(), LockTagHashCode(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), PROCLOCKTAG::myLock, VirtualTransactionId::procNumber, PGPROC::procNumber, ProcNumberGetProc(), SET_LOCKTAG_VIRTUALTRANSACTION, SetupLockInTable(), ShareLock, PROCLOCK::tag, VirtualTransactionIdIsRecoveredPreparedXact, VirtualTransactionIdIsValid, PGPROC::vxid, XactLockForVirtualXact(), and PGPROC::xid.
Referenced by ResolveRecoveryConflictWithVirtualXIDs(), WaitForLockersMultiple(), and WaitForOlderSnapshots().
Definition at line 4643 of file lock.c.
References Assert, DEFAULT_LOCKMETHOD, ExclusiveLock, PGPROC::fpInfoLock, PGPROC::fpLocalTransactionId, PGPROC::fpVXIDLock, INVALID_PROC_NUMBER, InvalidLocalTransactionId, VirtualTransactionId::localTransactionId, LocalTransactionIdIsValid, LockMethods, LockRefindAndRelease(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyProc, MyProcNumber, VirtualTransactionId::procNumber, PGPROC::procNumber, SET_LOCKTAG_VIRTUALTRANSACTION, and PGPROC::vxid.
Referenced by LockReleaseAll(), and ShutdownRecoveryTransactionEnvironment().
|
extern |
Definition at line 4620 of file lock.c.
References Assert, PGPROC::fpInfoLock, PGPROC::fpLocalTransactionId, PGPROC::fpVXIDLock, InvalidLocalTransactionId, VirtualTransactionId::localTransactionId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MyProc, VirtualTransactionId::procNumber, PGPROC::procNumber, VirtualTransactionIdIsValid, and PGPROC::vxid.
Referenced by InitRecoveryTransactionEnvironment(), and StartTransaction().
|
extern |
Definition at line 28 of file lockfuncs.c.
Referenced by GetLockNameFromTagType(), and pg_lock_status().
|
extern |
Definition at line 54 of file lock.c.
Referenced by heap_acquire_tuplock(), heap_lock_tuple(), and heapam_tuple_lock().
|
extern |
Definition at line 53 of file lock.c.
Referenced by CheckRequiredParameterValues(), InitControlFile(), InitializeFastPathLocks(), and XLogReportParameters().