|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "miscadmin.h"#include "pg_trace.h"#include "pgstat.h"#include "port/pg_bitutils.h"#include "storage/proc.h"#include "storage/proclist.h"#include "storage/procnumber.h"#include "storage/spin.h"#include "storage/subsystems.h"#include "utils/memutils.h"#include "utils/wait_event.h"#include "storage/lwlocklist.h"
Go to the source code of this file.
Data Structures | |
| struct | LWLockHandle |
| struct | LWLockTrancheShmemData |
| struct | NamedLWLockTrancheRequest |
Macros | |
| #define | LW_FLAG_HAS_WAITERS ((uint32) 1 << 31) |
| #define | LW_FLAG_WAKE_IN_PROGRESS ((uint32) 1 << 30) |
| #define | LW_FLAG_LOCKED ((uint32) 1 << 29) |
| #define | LW_FLAG_BITS 3 |
| #define | LW_FLAG_MASK (((1<<LW_FLAG_BITS)-1)<<(32-LW_FLAG_BITS)) |
| #define | LW_VAL_EXCLUSIVE (MAX_BACKENDS + 1) |
| #define | LW_VAL_SHARED 1 |
| #define | LW_SHARED_MASK MAX_BACKENDS |
| #define | LW_LOCK_MASK (MAX_BACKENDS | LW_VAL_EXCLUSIVE) |
| #define | PG_LWLOCK(id, lockname) [id] = CppAsString(lockname), |
| #define | PG_LWLOCKTRANCHE(id, lockname) [LWTRANCHE_##id] = CppAsString(lockname), |
| #define | MAX_SIMUL_LWLOCKS 200 |
| #define | MAX_USER_DEFINED_TRANCHES 256 |
| #define | T_NAME(lock) GetLWTrancheName((lock)->tranche) |
| #define | PRINT_LWDEBUG(a, b, c) ((void)0) |
| #define | LOG_LWDEBUG(a, b, c) ((void)0) |
Typedefs | |
| typedef struct LWLockHandle | LWLockHandle |
| typedef struct LWLockTrancheShmemData | LWLockTrancheShmemData |
| typedef struct NamedLWLockTrancheRequest | NamedLWLockTrancheRequest |
| #define LW_FLAG_MASK (((1<<LW_FLAG_BITS)-1)<<(32-LW_FLAG_BITS)) |
| #define LW_LOCK_MASK (MAX_BACKENDS | LW_VAL_EXCLUSIVE) |
| #define LW_SHARED_MASK MAX_BACKENDS |
| #define LW_VAL_EXCLUSIVE (MAX_BACKENDS + 1) |
| #define PG_LWLOCK | ( | id, | |
| lockname | |||
| ) | [id] = CppAsString(lockname), |
| #define PG_LWLOCKTRANCHE | ( | id, | |
| lockname | |||
| ) | [LWTRANCHE_##id] = CppAsString(lockname), |
| #define T_NAME | ( | lock | ) | GetLWTrancheName((lock)->tranche) |
Definition at line 229 of file lwlock.c.
| typedef struct LWLockHandle LWLockHandle |
Definition at line 747 of file lwlock.c.
References Assert, fb(), GetLWTrancheName(), and PG_WAIT_LWLOCK.
Referenced by pgstat_get_wait_event(), test_lwlock_get_lwlock_identifier(), and test_startup_lwlocks().
Definition at line 709 of file lwlock.c.
References BuiltinTrancheNames, elog, ERROR, fb(), idx(), LocalNumUserDefinedTranches, LWLockTrancheShmemData::lock, LWLockTranches, LWTRANCHE_FIRST_USER_DEFINED, LWLockTrancheShmemData::name, LWLockTrancheShmemData::num_user_defined, SpinLockAcquire(), SpinLockRelease(), and LWLockTrancheShmemData::user_defined.
Referenced by GetLWLockIdentifier(), and LWLockInitialize().
| LWLockPadded * GetNamedLWLockTranche | ( | const char * | tranche_name | ) |
Definition at line 522 of file lwlock.c.
References elog, ERROR, fb(), i, LocalNumUserDefinedTranches, LWLockTrancheShmemData::lock, LWLockTranches, LWLockTrancheShmemData::main_array_idx, MainLWLockArray, LWLockTrancheShmemData::name, LWLockTrancheShmemData::num_user_defined, SpinLockAcquire(), SpinLockRelease(), and LWLockTrancheShmemData::user_defined.
Referenced by test_lwlock_tranche_lookup(), and test_startup_lwlocks().
Definition at line 506 of file lwlock.c.
References fb().
Referenced by InitAuxiliaryProcess(), and InitProcess().
| bool LWLockAcquire | ( | LWLock * | lock, |
| LWLockMode | mode | ||
| ) |
Definition at line 1150 of file lwlock.c.
References Assert, elog, ERROR, fb(), held_lwlocks, HOLD_INTERRUPTS, IsUnderPostmaster, LWLockHandle::lock, LOG_LWDEBUG, LW_EXCLUSIVE, LW_FLAG_WAKE_IN_PROGRESS, LW_SHARED, LW_WS_NOT_WAITING, LWLockAttemptLock(), LWLockDequeueSelf(), LWLockQueueSelf(), LWLockReportWaitEnd(), LWLockReportWaitStart(), PGPROC::lwWaiting, MAX_BACKENDS, MAX_SIMUL_LWLOCKS, LWLockHandle::mode, mode, MyProc, num_held_lwlocks, pg_atomic_fetch_and_u32(), pg_atomic_fetch_sub_u32(), PG_USED_FOR_ASSERTS_ONLY, PGSemaphoreLock(), PGSemaphoreUnlock(), PRINT_LWDEBUG, result, PGPROC::sem, LWLock::state, and T_NAME.
Referenced by _bt_end_vacuum(), _bt_parallel_done(), _bt_parallel_primscan_schedule(), _bt_parallel_release(), _bt_parallel_seize(), _bt_start_vacuum(), _bt_vacuum_cycleid(), abort_logical_decoding_activation(), AbsorbSyncRequests(), ActivateCommitTs(), addLSNWaiter(), AdvanceNextFullTransactionIdPastXid(), AdvanceOldestClogXid(), AdvanceOldestCommitTsXid(), AdvanceXLInsertBuffer(), alloc_object(), AlterSystemSetConfigFile(), ApplyLauncherMain(), apw_detach_shmem(), apw_dump_now(), apw_load_buffers(), AsyncNotifyFreezeXids(), asyncQueueAddEntries(), asyncQueueAdvanceTail(), asyncQueueReadAllNotifications(), asyncQueueUnregister(), AtAbort_Twophase(), AtEOXact_LogicalRepWorkers(), AtPrepare_PredicateLocks(), attach_internal(), autoprewarm_main(), autoprewarm_start_worker(), AutoVacLauncherMain(), AutoVacuumRequestWork(), AutoVacWorkerMain(), BackendPidGetProc(), BackendXidGetPid(), BecomeLockGroupLeader(), BecomeLockGroupMember(), BecomeRegisteredListener(), btparallelrescan(), BufferAlloc(), CallShmemCallbacksAfterStartup(), check_for_freed_segments(), CheckDeadLock(), CheckForSerializableConflictOut(), CheckLogicalSlotExists(), CheckPointPredicate(), CheckPointRelationMap(), CheckPointReplicationOrigin(), CheckPointReplicationSlots(), CheckPointTwoPhase(), CheckTableForSerializableConflictIn(), CheckTargetForConflictsIn(), choose_next_subplan_for_leader(), choose_next_subplan_for_worker(), CleanupInvalidationState(), ClearOldPredicateLocks(), ComputeXidHorizons(), consume_xids_shortcut(), copy_replication_slot(), CountDBBackends(), CountDBConnections(), CountOtherDBBackends(), CountUserBackends(), CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreateInitDecodingContext(), CreatePredicateLock(), CreateRestartPoint(), DataChecksumsWorkerLauncherMain(), DataChecksumsWorkerMain(), DeactivateCommitTs(), DeleteChildTargetLocks(), DeleteLockTarget(), deleteLSNWaiter(), destroy_superblock(), DisableLogicalDecoding(), DisableLogicalDecodingIfNecessary(), do_autovacuum(), do_pg_backup_start(), do_pg_backup_stop(), do_start_worker(), DropAllPredicateLocksFromTable(), DropTableSpace(), dsa_allocate_extended(), dsa_dump(), dsa_free(), dsa_get_total_size(), dsa_get_total_size_from_handle(), dsa_pin(), dsa_release_in_place(), dsa_set_size_limit(), dsa_trim(), dsa_unpin(), dshash_delete_key(), dshash_dump(), dshash_find(), dshash_find_or_insert_extended(), dshash_seq_next(), dsm_attach(), dsm_create(), dsm_detach(), dsm_pin_segment(), dsm_unpin_segment(), EnableLogicalDecoding(), ensure_active_superblock(), entry_reset(), ExecParallelHashMergeCounters(), ExecParallelHashPopChunkQueue(), ExecParallelHashTupleAlloc(), ExecParallelHashTuplePrealloc(), ExpireAllKnownAssignedTransactionIds(), ExpireOldKnownAssignedTransactionIds(), ExpireTreeKnownAssignedTransactionIds(), ExtendBufferedRelShared(), ExtendCLOG(), ExtendCommitTs(), ExtendMultiXactMember(), ExtendMultiXactOffset(), ExtendSUBTRANS(), FastPathGetRelationLockEntry(), FastPathTransferRelationLocks(), FindAndDropRelationBuffers(), FindDeletedTupleInLocalRel(), FinishPreparedTransaction(), ForceTransactionIdLimitUpdate(), ForwardSyncRequest(), FreeWorkerInfo(), get_local_synced_slots(), get_val_in_shmem(), get_xid_status(), GetBackgroundWorkerPid(), GetBackgroundWorkerTypeByPid(), GetBlockerStatusData(), GetConflictingVirtualXIDs(), GetCurrentVirtualXIDs(), GetLastImportantRecPtr(), GetLastSegSwitchData(), GetLatestCommitTsData(), GetLeaderApplyWorkerPid(), GetLockConflicts(), GetLockStatusData(), GetMultiXactIdMembers(), GetMultiXactInfo(), GetNewMultiXactId(), GetNewObjectId(), GetNewTransactionId(), GetOldestActiveTransactionId(), GetOldestMultiXactId(), GetOldestRestartPoint(), GetOldestSafeDecodingTransactionId(), GetOldestUnsummarizedLSN(), GetPredicateLockStatusData(), GetPreparedTransactionList(), GetRunningTransactionData(), GetRunningTransactionLocks(), GetSafeSnapshot(), GetSafeSnapshotBlockingPids(), GetSerializableTransactionSnapshotInt(), GetSnapshotData(), GetStrictOldestNonRemovableTransactionId(), GetVirtualXIDsDelayingChkpt(), GetWaitEventCustomIdentifier(), GetWaitEventCustomNames(), GetWalSummarizerState(), HaveVirtualXIDsDelayingChkpt(), init_conflict_slot_xmin(), init_dsm_registry(), initGlobalChannelTable(), InitWalSender(), InjectionPointAttach(), InjectionPointDetach(), InjectionPointList(), InstallXLogFileSegment(), InvalidateBuffer(), InvalidateObsoleteReplicationSlots(), InvalidatePossiblyObsoleteSlot(), InvalidateVictimBuffer(), IoWorkerMain(), IsInstallXLogFileSegmentActive(), IsLogicalDecodingEnabled(), IsXLogLogicalInfoEnabled(), KnownAssignedXidsCompress(), KnownAssignedXidsReset(), launcher_exit(), lock_twophase_recover(), LockAcquireExtended(), LockErrorCleanup(), LockGXact(), LockHasWaiters(), LockRefindAndRelease(), LockRelease(), LockReleaseAll(), LockWaiterCount(), logicalrep_launcher_attach_dshmem(), logicalrep_pa_worker_stop(), logicalrep_reset_seqsync_start_time(), logicalrep_worker_attach(), logicalrep_worker_detach(), logicalrep_worker_launch(), logicalrep_worker_stop(), logicalrep_worker_stop_internal(), logicalrep_worker_wakeup(), logicalrep_workers_find(), LookupGXact(), LookupGXactBySubid(), MarkAsPrepared(), MarkAsPreparing(), multixact_redo(), MultiXactAdvanceNextMXact(), MultiXactGetCheckptMulti(), MultiXactIdSetOldestMember(), MultiXactIdSetOldestVisible(), MultiXactSetNextMXact(), PageIsPredicateLocked(), perform_relmap_update(), pg_control_checkpoint(), pg_control_init(), pg_control_recovery(), pg_control_system(), pg_create_advice_stash(), pg_drop_advice_stash(), pg_get_replication_slots(), pg_get_shmem_allocations(), pg_get_shmem_allocations_numa(), pg_notification_queue_usage(), pg_set_stashed_advice(), pg_show_replication_origin_status(), pg_start_stash_advice_worker(), pg_stash_advice_worker_main(), pg_stat_get_subscription(), pg_stat_statements_internal(), pg_xact_status(), pgaio_worker_can_timeout(), pgaio_worker_die(), pgaio_worker_register(), pgsa_attach(), pgsa_detach_shmem(), pgsa_read_from_disk(), pgsa_restore_entries(), pgsa_restore_stashes(), pgss_store(), pgstat_archiver_reset_all_cb(), pgstat_archiver_snapshot_cb(), pgstat_bgwriter_reset_all_cb(), pgstat_bgwriter_snapshot_cb(), pgstat_build_snapshot(), pgstat_checkpointer_reset_all_cb(), pgstat_checkpointer_snapshot_cb(), pgstat_fetch_replslot(), pgstat_io_flush_cb(), pgstat_io_reset_all_cb(), pgstat_io_snapshot_cb(), pgstat_lock_entry(), pgstat_lock_entry_shared(), pgstat_lock_flush_cb(), pgstat_lock_reset_all_cb(), pgstat_lock_snapshot_cb(), pgstat_reset_matching_entries(), pgstat_reset_replslot(), pgstat_reset_slru_counter_internal(), pgstat_slru_flush_cb(), pgstat_slru_snapshot_cb(), pgstat_wal_flush_cb(), pgstat_wal_reset_all_cb(), pgstat_wal_snapshot_cb(), PostPrepare_Locks(), PostPrepare_MultiXact(), PostPrepare_Twophase(), PreCommit_CheckForSerializationFailure(), PreCommit_Notify(), predicatelock_twophase_recover(), PredicateLockPageSplit(), PredicateLockShmemInit(), PredicateLockTwoPhaseFinish(), PrefetchSharedBuffer(), PrescanPreparedTransactions(), ProcArrayAdd(), ProcArrayApplyRecoveryInfo(), ProcArrayApplyXidAssignment(), ProcArrayClearTransaction(), ProcArrayEndTransaction(), ProcArrayGetReplicationSlotXmin(), ProcArrayGroupClearXid(), ProcArrayInstallImportedXmin(), ProcArrayInstallRestoredXmin(), ProcArrayRemove(), ProcArraySetReplicationSlotXmin(), ProcessDatabase(), ProcessSequencesForSync(), ProcessSingleRelationFork(), ProcessSyncingTablesForApply(), ProcKill(), ProcNumberGetTransactionIds(), ProcSleep(), ReachedEndOfBackup(), read_relmap_file(), ReadMultiXactIdRange(), ReadNextFullTransactionId(), ReadNextMultiXactId(), ReadReplicationSlot(), RecordNewMultiXact(), RecoverPreparedTransactions(), RegisterDynamicBackgroundWorker(), RegisterPredicateLockingXid(), RelationCacheInitFilePreInvalidate(), RelationMapCopy(), RelationMapFinishBootstrap(), ReleaseOneSerializableXact(), ReleasePredicateLocks(), relmap_redo(), RemoveScratchTarget(), ReplicationSlotAcquire(), ReplicationSlotCleanup(), ReplicationSlotCreate(), ReplicationSlotDropPtr(), ReplicationSlotName(), ReplicationSlotRelease(), ReplicationSlotReserveWal(), ReplicationSlotsComputeLogicalRestartLSN(), ReplicationSlotsComputeRequiredLSN(), ReplicationSlotsComputeRequiredXmin(), ReplicationSlotsCountDBSlots(), ReplicationSlotsDropDBSlots(), replorigin_advance(), replorigin_get_progress(), replorigin_session_advance(), replorigin_session_get_progress(), replorigin_session_reset_internal(), replorigin_session_setup(), replorigin_state_clear(), RequestDisableLogicalDecoding(), reserve_wal_for_local_slot(), ResetInstallXLogFileSegmentActive(), resize(), RestoreScratchTarget(), restoreTwoPhaseData(), SaveSlotToPath(), SearchNamedReplicationSlot(), SerialAdd(), SerialGetMinConflictCommitSeqNo(), SerialSetActiveSerXmin(), set_indexsafe_procflags(), set_val_in_shmem(), SetCommitTsLimit(), SetDataChecksumsOff(), SetDataChecksumsOn(), SetDataChecksumsOnInProgress(), SetInstallXLogFileSegmentActive(), SetMultiXactIdLimit(), SetNextObjectId(), SetOldestOffset(), SetTransactionIdLimit(), SetXidCommitTsInPage(), SharedInvalBackendInit(), ShmemInitStruct(), SICleanupQueue(), SIGetDataEntries(), SignalBackends(), SignalRecoveryConflict(), SignalRecoveryConflictWithDatabase(), SignalRecoveryConflictWithVirtualXID(), SIInsertDataEntries(), SimpleLruReadPage(), SimpleLruReadPage_ReadOnly(), SimpleLruTruncate(), SimpleLruWaitIO(), SimpleLruWriteAll(), SimpleLruZeroAndWritePage(), SlruDeleteSegment(), SlruInternalWritePage(), SnapBuildInitialSnapshot(), ss_get_location(), StandbyRecoverPreparedTransactions(), StandbySlotsHaveCaughtup(), StartDataChecksumsWorkerLauncher(), StartupDecodingContext(), StartupSUBTRANS(), StartupXLOG(), sts_parallel_scan_next(), SubTransSetParent(), SummarizeOldestCommittedSxact(), SummarizeWAL(), SwitchIntoArchiveRecovery(), synchronize_one_slot(), SyncRepCancelWait(), SyncRepCleanupAtProcExit(), SyncRepReleaseWaiters(), SyncRepUpdateSyncStandbysDefined(), SyncRepWaitForLSN(), TablespaceCreateDbspace(), tbm_shared_iterate(), TerminateBackgroundWorker(), TerminateBackgroundWorkersForDatabase(), TerminateOtherDBBackends(), test_custom_stats_fixed_reset_all_cb(), test_custom_stats_fixed_snapshot_cb(), test_custom_stats_fixed_update(), test_slru_page_exists(), test_slru_page_read(), test_slru_page_write(), test_startup_lwlocks(), TransactionGroupUpdateXidStatus(), TransactionIdGetCommitTsData(), TransactionIdIsInProgress(), TransactionIdSetPageStatus(), TransactionTreeSetCommitTsData(), TransferPredicateLocksToNewTarget(), TrimCLOG(), TrimMultiXact(), TruncateMultiXact(), TwoPhaseGetGXact(), TwoPhaseGetOldestXidInCommit(), TwoPhaseGetXidByVirtualXID(), update_cached_xid_range(), update_synced_slots_inactive_since(), UpdateLogicalDecodingStatusEndOfRecovery(), UpdateMinRecoveryPoint(), vac_truncate_clog(), vacuum_rel(), VacuumUpdateCosts(), VirtualXactLock(), VirtualXactLockTableCleanup(), VirtualXactLockTableInsert(), wait_for_table_state_change(), wait_for_worker_state_change(), WaitEventCustomNew(), WaitForAllTransactionsToFinish(), WaitForReplicationWorkerAttach(), WaitForWalSummarization(), wakeupWaiters(), WakeupWalSummarizer(), WALInsertLockAcquire(), WALInsertLockAcquireExclusive(), WalSummarizerMain(), WalSummarizerShutdown(), write_relcache_init_file(), xact_redo(), XidCacheRemoveRunningXids(), xlog_redo(), XLogBackgroundFlush(), and XLogReportParameters().
| bool LWLockAcquireOrWait | ( | LWLock * | lock, |
| LWLockMode | mode | ||
| ) |
Definition at line 1378 of file lwlock.c.
References Assert, elog, ERROR, fb(), held_lwlocks, HOLD_INTERRUPTS, LWLockHandle::lock, LOG_LWDEBUG, LW_EXCLUSIVE, LW_SHARED, LW_WAIT_UNTIL_FREE, LW_WS_NOT_WAITING, LWLockAttemptLock(), LWLockDequeueSelf(), LWLockQueueSelf(), LWLockReportWaitEnd(), LWLockReportWaitStart(), PGPROC::lwWaiting, MAX_BACKENDS, MAX_SIMUL_LWLOCKS, LWLockHandle::mode, mode, MyProc, num_held_lwlocks, pg_atomic_fetch_sub_u32(), PG_USED_FOR_ASSERTS_ONLY, PGSemaphoreLock(), PGSemaphoreUnlock(), PRINT_LWDEBUG, RESUME_INTERRUPTS, PGPROC::sem, and T_NAME.
Referenced by XLogFlush().
Definition at line 1903 of file lwlock.c.
References fb(), held_lwlocks, i, and num_held_lwlocks.
|
static |
Definition at line 764 of file lwlock.c.
References Assert, fb(), LW_EXCLUSIVE, LW_LOCK_MASK, LW_SHARED, LW_VAL_EXCLUSIVE, LW_VAL_SHARED, mode, MyProc, pg_atomic_compare_exchange_u32(), pg_atomic_read_u32(), pg_unreachable, and LWLock::state.
Referenced by LWLockAcquire(), LWLockAcquireOrWait(), and LWLockConditionalAcquire().
| bool LWLockConditionalAcquire | ( | LWLock * | lock, |
| LWLockMode | mode | ||
| ) |
Definition at line 1321 of file lwlock.c.
References Assert, elog, ERROR, fb(), held_lwlocks, HOLD_INTERRUPTS, LWLockHandle::lock, LOG_LWDEBUG, LW_EXCLUSIVE, LW_SHARED, LWLockAttemptLock(), MAX_SIMUL_LWLOCKS, LWLockHandle::mode, mode, num_held_lwlocks, PRINT_LWDEBUG, RESUME_INTERRUPTS, and T_NAME.
Referenced by pgaio_worker_submit(), pgstat_io_flush_cb(), pgstat_lock_entry(), pgstat_lock_entry_shared(), pgstat_lock_flush_cb(), pgstat_slru_flush_cb(), pgstat_wal_flush_cb(), ProcArrayEndTransaction(), SimpleLruWaitIO(), ss_report_location(), TransactionIdSetPageStatus(), and XLogNeedsFlush().
|
static |
Definition at line 1505 of file lwlock.c.
References fb(), LW_VAL_EXCLUSIVE, newval, pg_atomic_read_u32(), pg_atomic_read_u64(), result, LWLock::state, and value.
Referenced by LWLockWaitForVar().
Definition at line 1061 of file lwlock.c.
References Assert, fb(), LW_FLAG_HAS_WAITERS, LW_FLAG_WAKE_IN_PROGRESS, LW_WS_NOT_WAITING, LW_WS_WAITING, LWLockWaitListLock(), LWLockWaitListUnlock(), PGPROC::lwWaiting, MAX_BACKENDS, MyProc, MyProcNumber, pg_atomic_fetch_and_u32(), pg_atomic_fetch_sub_u32(), pg_atomic_read_u32(), PG_USED_FOR_ASSERTS_ONLY, PGSemaphoreLock(), PGSemaphoreUnlock(), proclist_delete, proclist_is_empty(), PGPROC::sem, LWLock::state, and LWLock::waiters.
Referenced by LWLockAcquire(), LWLockAcquireOrWait(), and LWLockWaitForVar().
Definition at line 1885 of file lwlock.c.
References held_lwlocks, i, and num_held_lwlocks.
Referenced by alloc_object(), autovac_recalculate_workers_for_balance(), check_for_freed_segments_locked(), CompactCheckpointerRequestQueue(), delete_item(), DeleteLockTarget(), dshash_dump(), ensure_active_superblock(), get_best_segment(), GetLockHoldersAndWaiters(), GetOldestSafeDecodingTransactionId(), GetSnapshotDataReuse(), init_span(), InvalidatePossiblyObsoleteSlot(), logicalrep_pa_worker_count(), logicalrep_sync_worker_count(), logicalrep_worker_find(), logicalrep_worker_wakeup_ptr(), logicalrep_workers_find(), MaintainLatestCompletedXid(), MaintainLatestCompletedXidRecovery(), make_new_segment(), OnConflict_CheckForSerializationFailure(), pgsa_clear_advice_string(), pgsa_set_advice_string(), ProcArrayEndTransaction(), ProcArraySetReplicationSlotXmin(), ProcSleep(), ReleaseOneSerializableXact(), RemoveScratchTarget(), RemoveTargetIfNoLongerUsed(), resize(), RestoreScratchTarget(), SetNewSxactGlobalXmin(), SlruSelectLRUPage(), test_slru_page_readonly(), TransactionIdInRecentPast(), TwoPhaseGetGXact(), and VacuumUpdateCosts().
| bool LWLockHeldByMeInMode | ( | LWLock * | lock, |
| LWLockMode | mode | ||
| ) |
Definition at line 1929 of file lwlock.c.
References held_lwlocks, i, mode, and num_held_lwlocks.
Referenced by DeleteLockTarget(), dshash_delete_current(), dshash_delete_entry(), dshash_seq_next(), InvalidatePossiblyObsoleteSlot(), JoinWaitQueue(), logicalrep_worker_cleanup(), logicalrep_worker_stop_internal(), MarkAsPreparingGuts(), pgaio_worker_choose_idle(), pgaio_worker_submission_queue_consume(), pgaio_worker_submission_queue_depth(), pgaio_worker_submission_queue_insert(), pgsa_create_stash(), pgsa_drop_stash(), pgsa_reset_all_stashes(), pgstat_create_replslot(), pgstat_drop_replslot(), PrepareRedoAdd(), PrepareRedoRemoveFull(), ProcArrayEndTransactionInternal(), ProcessTwoPhaseBuffer(), RemoveGXact(), ReplicationSlotsComputeRequiredXmin(), SimpleLruReadPage(), SimpleLruZeroPage(), SlruInternalWritePage(), SyncRepWakeQueue(), TransactionIdSetPageStatusInternal(), TransactionIdSetStatusBit(), TransferPredicateLocksToNewTarget(), and write_relmap_file().
Definition at line 670 of file lwlock.c.
References fb(), GetLWTrancheName(), pg_atomic_init_u32(), proclist_init(), LWLock::state, LWLock::tranche, and LWLock::waiters.
Referenced by apw_init_state(), btinitparallelscan(), create_internal(), dshash_create(), ExecAppendInitializeDSM(), ExecHashJoinInitializeDSM(), init_tdr_dsm(), InitShmemAllocator(), LWLockShmemInit(), pgsa_init_shared_state(), pgss_shmem_init(), pgstat_archiver_init_shmem_cb(), pgstat_bgwriter_init_shmem_cb(), pgstat_checkpointer_init_shmem_cb(), pgstat_init_entry(), pgstat_io_init_shmem_cb(), pgstat_lock_init_shmem_cb(), pgstat_slru_init_shmem_cb(), pgstat_wal_init_shmem_cb(), PredicateLockShmemInit(), ProcGlobalShmemInit(), ReplicationOriginShmemInit(), ReplicationSlotsShmemInit(), shmem_slru_init(), sts_initialize(), tbm_prepare_shared_iterate(), test_custom_stats_fixed_init_shmem_cb(), test_lwlock_initialize(), and XLOGShmemInit().
Definition at line 562 of file lwlock.c.
References ereport, errcode(), errdetail(), errmsg, ERROR, fb(), idx(), LocalNumUserDefinedTranches, LWLockTrancheShmemData::lock, LWLockTranches, LWTRANCHE_FIRST_USER_DEFINED, LWLockTrancheShmemData::main_array_idx, MAX_USER_DEFINED_TRANCHES, LWLockTrancheShmemData::name, name, NAMEDATALEN, LWLockTrancheShmemData::num_user_defined, SpinLockAcquire(), SpinLockRelease(), strlcpy(), and LWLockTrancheShmemData::user_defined.
Referenced by apw_init_state(), GetNamedDSA(), GetNamedDSHash(), init_tdr_dsm(), init_tranche(), pgsa_init_shared_state(), pgss_shmem_init(), shmem_slru_init(), test_basic(), test_create(), test_empty(), test_lwlock_tranche_create(), and test_random().
|
static |
Definition at line 1018 of file lwlock.c.
References elog, fb(), LW_FLAG_HAS_WAITERS, LW_WAIT_UNTIL_FREE, LW_WS_NOT_WAITING, LW_WS_WAITING, LWLockWaitListLock(), LWLockWaitListUnlock(), PGPROC::lwWaiting, PGPROC::lwWaitMode, mode, MyProc, MyProcNumber, PANIC, pg_atomic_fetch_add_u32(), pg_atomic_fetch_or_u32(), proclist_push_head, proclist_push_tail, LWLock::state, and LWLock::waiters.
Referenced by LWLockAcquire(), LWLockAcquireOrWait(), and LWLockWaitForVar().
Definition at line 1767 of file lwlock.c.
References Assert, elog, ERROR, fb(), held_lwlocks, i, LOG_LWDEBUG, LW_EXCLUSIVE, LW_FLAG_HAS_WAITERS, LW_FLAG_WAKE_IN_PROGRESS, LW_LOCK_MASK, LW_VAL_EXCLUSIVE, LW_VAL_SHARED, LWLockWakeup(), LWLockHandle::mode, mode, num_held_lwlocks, pg_atomic_sub_fetch_u32(), PRINT_LWDEBUG, RESUME_INTERRUPTS, LWLock::state, and T_NAME.
Referenced by _bt_end_vacuum(), _bt_parallel_done(), _bt_parallel_primscan_schedule(), _bt_parallel_release(), _bt_parallel_seize(), _bt_start_vacuum(), _bt_vacuum_cycleid(), abort_logical_decoding_activation(), AbsorbSyncRequests(), ActivateCommitTs(), addLSNWaiter(), AdvanceNextFullTransactionIdPastXid(), AdvanceOldestClogXid(), AdvanceOldestCommitTsXid(), AdvanceXLInsertBuffer(), alloc_object(), AlterSystemSetConfigFile(), ApplyLauncherMain(), apw_detach_shmem(), apw_dump_now(), apw_load_buffers(), AsyncNotifyFreezeXids(), asyncQueueAddEntries(), asyncQueueAdvanceTail(), asyncQueueProcessPageEntries(), asyncQueueReadAllNotifications(), asyncQueueUnregister(), AtAbort_Twophase(), AtEOXact_LogicalRepWorkers(), AtPrepare_PredicateLocks(), attach_internal(), autoprewarm_main(), autoprewarm_start_worker(), AutoVacLauncherMain(), AutoVacuumRequestWork(), AutoVacWorkerMain(), BackendPidGetProc(), BackendXidGetPid(), BecomeLockGroupLeader(), BecomeLockGroupMember(), BecomeRegisteredListener(), btparallelrescan(), BufferAlloc(), CallShmemCallbacksAfterStartup(), check_for_freed_segments(), CheckDeadLock(), CheckForSerializableConflictOut(), CheckLogicalSlotExists(), CheckPointPredicate(), CheckPointRelationMap(), CheckPointReplicationOrigin(), CheckPointReplicationSlots(), CheckPointTwoPhase(), CheckTableForSerializableConflictIn(), CheckTargetForConflictsIn(), choose_next_subplan_for_leader(), choose_next_subplan_for_worker(), CleanupInvalidationState(), ClearOldPredicateLocks(), ComputeXidHorizons(), consume_xids_shortcut(), copy_replication_slot(), CountDBBackends(), CountDBConnections(), CountOtherDBBackends(), CountUserBackends(), CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreateInitDecodingContext(), CreatePredicateLock(), CreateRestartPoint(), DataChecksumsWorkerLauncherMain(), DataChecksumsWorkerMain(), DeactivateCommitTs(), DeleteChildTargetLocks(), DeleteLockTarget(), deleteLSNWaiter(), destroy_superblock(), DisableLogicalDecoding(), DisableLogicalDecodingIfNecessary(), do_autovacuum(), do_pg_backup_start(), do_pg_backup_stop(), do_start_worker(), DropAllPredicateLocksFromTable(), DropTableSpace(), dsa_allocate_extended(), dsa_dump(), dsa_free(), dsa_get_total_size(), dsa_get_total_size_from_handle(), dsa_pin(), dsa_release_in_place(), dsa_set_size_limit(), dsa_trim(), dsa_unpin(), dshash_delete_entry(), dshash_delete_key(), dshash_dump(), dshash_find(), dshash_find_or_insert_extended(), dshash_release_lock(), dshash_seq_next(), dshash_seq_term(), dsm_attach(), dsm_create(), dsm_detach(), dsm_pin_segment(), dsm_unpin_segment(), EnableLogicalDecoding(), ensure_active_superblock(), entry_reset(), ExecParallelHashMergeCounters(), ExecParallelHashPopChunkQueue(), ExecParallelHashTupleAlloc(), ExecParallelHashTuplePrealloc(), ExpireAllKnownAssignedTransactionIds(), ExpireOldKnownAssignedTransactionIds(), ExpireTreeKnownAssignedTransactionIds(), ExtendBufferedRelShared(), ExtendCLOG(), ExtendCommitTs(), ExtendMultiXactMember(), ExtendMultiXactOffset(), ExtendSUBTRANS(), FastPathGetRelationLockEntry(), FastPathTransferRelationLocks(), find_multixact_start(), FindAndDropRelationBuffers(), FindDeletedTupleInLocalRel(), FinishPreparedTransaction(), ForceTransactionIdLimitUpdate(), ForwardSyncRequest(), FreeWorkerInfo(), get_local_synced_slots(), get_val_in_shmem(), get_xid_status(), GetBackgroundWorkerPid(), GetBackgroundWorkerTypeByPid(), GetBlockerStatusData(), GetConflictingVirtualXIDs(), GetCurrentVirtualXIDs(), GetLastImportantRecPtr(), GetLastSegSwitchData(), GetLatestCommitTsData(), GetLeaderApplyWorkerPid(), GetLockConflicts(), GetLockStatusData(), GetMultiXactIdMembers(), GetMultiXactInfo(), GetNewMultiXactId(), GetNewObjectId(), GetNewTransactionId(), GetOldestActiveTransactionId(), GetOldestMultiXactId(), GetOldestRestartPoint(), GetOldestSafeDecodingTransactionId(), GetOldestUnsummarizedLSN(), GetPredicateLockStatusData(), GetPreparedTransactionList(), GetRunningTransactionLocks(), GetSafeSnapshot(), GetSafeSnapshotBlockingPids(), GetSerializableTransactionSnapshotInt(), GetSnapshotData(), GetStrictOldestNonRemovableTransactionId(), GetVirtualXIDsDelayingChkpt(), GetWaitEventCustomIdentifier(), GetWaitEventCustomNames(), GetWalSummarizerState(), HaveVirtualXIDsDelayingChkpt(), init_conflict_slot_xmin(), init_dsm_registry(), initGlobalChannelTable(), InitWalSender(), InjectionPointAttach(), InjectionPointDetach(), InjectionPointList(), InstallXLogFileSegment(), InvalidateBuffer(), InvalidateObsoleteReplicationSlots(), InvalidatePossiblyObsoleteSlot(), InvalidateVictimBuffer(), IoWorkerMain(), IsInstallXLogFileSegmentActive(), IsLogicalDecodingEnabled(), IsXLogLogicalInfoEnabled(), KnownAssignedXidsCompress(), KnownAssignedXidsReset(), launcher_exit(), lock_twophase_recover(), LockAcquireExtended(), LockErrorCleanup(), LockGXact(), LockHasWaiters(), LockRefindAndRelease(), LockRelease(), LockReleaseAll(), LockWaiterCount(), logicalrep_launcher_attach_dshmem(), logicalrep_pa_worker_stop(), logicalrep_reset_seqsync_start_time(), logicalrep_worker_attach(), logicalrep_worker_detach(), logicalrep_worker_launch(), logicalrep_worker_stop(), logicalrep_worker_stop_internal(), logicalrep_worker_wakeup(), logicalrep_workers_find(), LogStandbySnapshot(), LookupGXact(), LookupGXactBySubid(), LWLockReleaseAll(), LWLockReleaseClearVar(), MarkAsPrepared(), MarkAsPreparing(), multixact_redo(), MultiXactAdvanceNextMXact(), MultiXactGetCheckptMulti(), MultiXactIdSetOldestMember(), MultiXactIdSetOldestVisible(), MultiXactSetNextMXact(), OnConflict_CheckForSerializationFailure(), PageIsPredicateLocked(), perform_relmap_update(), pg_control_checkpoint(), pg_control_init(), pg_control_recovery(), pg_control_system(), pg_create_advice_stash(), pg_drop_advice_stash(), pg_get_replication_slots(), pg_get_shmem_allocations(), pg_get_shmem_allocations_numa(), pg_notification_queue_usage(), pg_set_stashed_advice(), pg_show_replication_origin_status(), pg_start_stash_advice_worker(), pg_stash_advice_worker_main(), pg_stat_get_subscription(), pg_stat_statements_internal(), pg_xact_status(), pgaio_worker_can_timeout(), pgaio_worker_die(), pgaio_worker_register(), pgaio_worker_submit(), pgsa_attach(), pgsa_detach_shmem(), pgsa_read_from_disk(), pgsa_restore_entries(), pgsa_restore_stashes(), pgss_store(), pgstat_archiver_reset_all_cb(), pgstat_archiver_snapshot_cb(), pgstat_bgwriter_reset_all_cb(), pgstat_bgwriter_snapshot_cb(), pgstat_build_snapshot(), pgstat_checkpointer_reset_all_cb(), pgstat_checkpointer_snapshot_cb(), pgstat_fetch_replslot(), pgstat_io_flush_cb(), pgstat_io_reset_all_cb(), pgstat_io_snapshot_cb(), pgstat_lock_flush_cb(), pgstat_lock_reset_all_cb(), pgstat_lock_snapshot_cb(), pgstat_reset_matching_entries(), pgstat_reset_replslot(), pgstat_reset_slru_counter_internal(), pgstat_slru_flush_cb(), pgstat_slru_snapshot_cb(), pgstat_unlock_entry(), pgstat_wal_flush_cb(), pgstat_wal_reset_all_cb(), pgstat_wal_snapshot_cb(), PostPrepare_Locks(), PostPrepare_MultiXact(), PostPrepare_Twophase(), PreCommit_CheckForSerializationFailure(), PreCommit_Notify(), predicatelock_twophase_recover(), PredicateLockPageSplit(), PredicateLockShmemInit(), PredicateLockTwoPhaseFinish(), PrefetchSharedBuffer(), PrescanPreparedTransactions(), ProcArrayAdd(), ProcArrayApplyRecoveryInfo(), ProcArrayApplyXidAssignment(), ProcArrayClearTransaction(), ProcArrayEndTransaction(), ProcArrayGetReplicationSlotXmin(), ProcArrayGroupClearXid(), ProcArrayInstallImportedXmin(), ProcArrayInstallRestoredXmin(), ProcArrayRemove(), ProcArraySetReplicationSlotXmin(), ProcessDatabase(), ProcessSequencesForSync(), ProcessSingleRelationFork(), ProcessSyncingTablesForApply(), ProcKill(), ProcNumberGetTransactionIds(), ProcSleep(), ReachedEndOfBackup(), read_relmap_file(), ReadMultiXactIdRange(), ReadNextFullTransactionId(), ReadNextMultiXactId(), ReadReplicationSlot(), RecordNewMultiXact(), RecoverPreparedTransactions(), RegisterDynamicBackgroundWorker(), RegisterPredicateLockingXid(), RelationCacheInitFilePostInvalidate(), RelationMapCopy(), RelationMapFinishBootstrap(), ReleaseOneSerializableXact(), ReleasePredicateLocks(), relmap_redo(), RemoveScratchTarget(), ReplicationSlotAcquire(), ReplicationSlotCleanup(), ReplicationSlotCreate(), ReplicationSlotDropPtr(), ReplicationSlotName(), ReplicationSlotRelease(), ReplicationSlotReserveWal(), ReplicationSlotsComputeLogicalRestartLSN(), ReplicationSlotsComputeRequiredLSN(), ReplicationSlotsComputeRequiredXmin(), ReplicationSlotsCountDBSlots(), ReplicationSlotsDropDBSlots(), replorigin_advance(), replorigin_get_progress(), replorigin_session_advance(), replorigin_session_get_progress(), replorigin_session_reset_internal(), replorigin_session_setup(), replorigin_state_clear(), RequestDisableLogicalDecoding(), reserve_wal_for_local_slot(), ResetInstallXLogFileSegmentActive(), resize(), RestoreScratchTarget(), restoreTwoPhaseData(), SaveSlotToPath(), SearchNamedReplicationSlot(), SerialAdd(), SerialGetMinConflictCommitSeqNo(), SerialSetActiveSerXmin(), set_indexsafe_procflags(), set_val_in_shmem(), SetCommitTsLimit(), SetDataChecksumsOff(), SetDataChecksumsOn(), SetDataChecksumsOnInProgress(), SetInstallXLogFileSegmentActive(), SetMultiXactIdLimit(), SetNextObjectId(), SetOldestOffset(), SetTransactionIdLimit(), SetXidCommitTsInPage(), SharedInvalBackendInit(), ShmemInitStruct(), SICleanupQueue(), SIGetDataEntries(), SignalBackends(), SignalRecoveryConflict(), SignalRecoveryConflictWithDatabase(), SignalRecoveryConflictWithVirtualXID(), SIInsertDataEntries(), SimpleLruReadPage(), SimpleLruReadPage_ReadOnly(), SimpleLruTruncate(), SimpleLruWaitIO(), SimpleLruWriteAll(), SimpleLruZeroAndWritePage(), SlruDeleteSegment(), SlruInternalWritePage(), SnapBuildInitialSnapshot(), ss_get_location(), ss_report_location(), StandbyRecoverPreparedTransactions(), StandbySlotsHaveCaughtup(), StartDataChecksumsWorkerLauncher(), StartupDecodingContext(), StartupSUBTRANS(), StartupXLOG(), sts_parallel_scan_next(), SubTransGetParent(), SubTransSetParent(), SummarizeOldestCommittedSxact(), SummarizeWAL(), SwitchIntoArchiveRecovery(), synchronize_one_slot(), SyncRepCancelWait(), SyncRepCleanupAtProcExit(), SyncRepReleaseWaiters(), SyncRepUpdateSyncStandbysDefined(), SyncRepWaitForLSN(), TablespaceCreateDbspace(), tbm_shared_iterate(), TerminateBackgroundWorker(), TerminateBackgroundWorkersForDatabase(), TerminateOtherDBBackends(), test_custom_stats_fixed_reset_all_cb(), test_custom_stats_fixed_snapshot_cb(), test_custom_stats_fixed_update(), test_slru_page_exists(), test_slru_page_read(), test_slru_page_readonly(), test_slru_page_write(), test_startup_lwlocks(), TransactionGroupUpdateXidStatus(), TransactionIdGetCommitTsData(), TransactionIdGetStatus(), TransactionIdIsInProgress(), TransactionIdSetPageStatus(), TransactionTreeSetCommitTsData(), TransferPredicateLocksToNewTarget(), TrimCLOG(), TrimMultiXact(), TruncateMultiXact(), TwoPhaseGetGXact(), TwoPhaseGetOldestXidInCommit(), TwoPhaseGetXidByVirtualXID(), update_cached_xid_range(), update_synced_slots_inactive_since(), UpdateLogicalDecodingStatusEndOfRecovery(), UpdateMinRecoveryPoint(), vac_truncate_clog(), vacuum_rel(), VacuumUpdateCosts(), VirtualXactLock(), VirtualXactLockTableCleanup(), VirtualXactLockTableInsert(), wait_for_table_state_change(), wait_for_worker_state_change(), WaitEventCustomNew(), WaitForAllTransactionsToFinish(), WaitForReplicationWorkerAttach(), WaitForWalSummarization(), wakeupWaiters(), WakeupWalSummarizer(), WalSummarizerMain(), WalSummarizerShutdown(), write_relcache_init_file(), xact_redo(), XidCacheRemoveRunningXids(), xlog_redo(), XLogBackgroundFlush(), XLogFlush(), XLogNeedsFlush(), and XLogReportParameters().
Definition at line 1866 of file lwlock.c.
References Assert, held_lwlocks, HOLD_INTERRUPTS, LWLockRelease(), and num_held_lwlocks.
Referenced by AbortSubTransaction(), AbortTransaction(), AutoVacLauncherMain(), AuxiliaryProcKill(), BackgroundWriterMain(), CheckpointerMain(), IoWorkerMain(), pgarch_archiveXlog(), ProcKill(), shmem_exit(), ShutdownAuxiliaryProcess(), WalSndErrorCleanup(), WalSummarizerMain(), and WalWriterMain().
| void LWLockReleaseClearVar | ( | LWLock * | lock, |
| pg_atomic_uint64 * | valptr, | ||
| uint64 | val | ||
| ) |
Definition at line 1840 of file lwlock.c.
References fb(), LWLockRelease(), pg_atomic_exchange_u64(), and val.
Referenced by WALInsertLockRelease().
Definition at line 700 of file lwlock.c.
References pgstat_report_wait_end().
Referenced by LWLockAcquire(), LWLockAcquireOrWait(), and LWLockWaitForVar().
Definition at line 691 of file lwlock.c.
References PG_WAIT_LWLOCK, pgstat_report_wait_start(), and LWLock::tranche.
Referenced by LWLockAcquire(), LWLockAcquireOrWait(), and LWLockWaitForVar().
Definition at line 445 of file lwlock.c.
References Assert, BUFFER_MAPPING_LWLOCK_OFFSET, fb(), foreach_ptr, i, idx(), LWLockTrancheShmemData::lock, LOCK_MANAGER_LWLOCK_OFFSET, LWLockInitialize(), LWLockTranches, LWTRANCHE_FIRST_USER_DEFINED, LWLockTrancheShmemData::main_array_idx, MainLWLockArray, LWLockTrancheShmemData::name, NAMEDATALEN, NamedLWLockTrancheRequests, NUM_BUFFER_PARTITIONS, NUM_FIXED_LWLOCKS, NUM_LOCK_PARTITIONS, num_main_array_locks, NUM_PREDICATELOCK_PARTITIONS, LWLockTrancheShmemData::num_user_defined, PREDICATELOCK_MANAGER_LWLOCK_OFFSET, SpinLockInit(), strlcpy(), and LWLockTrancheShmemData::user_defined.
Definition at line 416 of file lwlock.c.
References IsUnderPostmaster, LWLockTranches, MainLWLockArray, name, NUM_FIXED_LWLOCKS, num_main_array_locks, NumLWLocksForNamedTranches(), SHMEM_ATTACH_UNKNOWN_SIZE, and ShmemRequestStruct.
| void LWLockUpdateVar | ( | LWLock * | lock, |
| pg_atomic_uint64 * | valptr, | ||
| uint64 | val | ||
| ) |
Definition at line 1702 of file lwlock.c.
References Assert, proclist_mutable_iter::cur, fb(), GetPGProcByNumber, LW_EXCLUSIVE, LW_VAL_EXCLUSIVE, LW_WAIT_UNTIL_FREE, LW_WS_NOT_WAITING, LW_WS_PENDING_WAKEUP, LW_WS_WAITING, LWLockWaitListLock(), LWLockWaitListUnlock(), PGPROC::lwWaiting, PGPROC::lwWaitMode, pg_atomic_exchange_u64(), pg_atomic_read_u32(), pg_write_barrier, PGSemaphoreUnlock(), PRINT_LWDEBUG, proclist_delete, proclist_foreach_modify, proclist_init(), proclist_push_tail, PGPROC::sem, LWLock::state, val, LWLock::waiters, and wakeup.
Referenced by WALInsertLockAcquireExclusive(), and WALInsertLockUpdateInsertingAt().
| bool LWLockWaitForVar | ( | LWLock * | lock, |
| pg_atomic_uint64 * | valptr, | ||
| uint64 | oldval, | ||
| uint64 * | newval | ||
| ) |
Definition at line 1566 of file lwlock.c.
References Assert, fb(), HOLD_INTERRUPTS, LOG_LWDEBUG, LW_EXCLUSIVE, LW_FLAG_WAKE_IN_PROGRESS, LW_WAIT_UNTIL_FREE, LW_WS_NOT_WAITING, LWLockConflictsWithVar(), LWLockDequeueSelf(), LWLockQueueSelf(), LWLockReportWaitEnd(), LWLockReportWaitStart(), PGPROC::lwWaiting, MAX_BACKENDS, MyProc, newval, pg_atomic_fetch_and_u32(), pg_atomic_fetch_sub_u32(), PG_USED_FOR_ASSERTS_ONLY, PGSemaphoreLock(), PGSemaphoreUnlock(), PRINT_LWDEBUG, result, RESUME_INTERRUPTS, PGPROC::sem, LWLock::state, and T_NAME.
Referenced by WaitXLogInsertionsToFinish().
Definition at line 835 of file lwlock.c.
References fb(), finish_spin_delay(), init_local_spin_delay, likely, LW_FLAG_LOCKED, perform_spin_delay(), pg_atomic_fetch_or_u32(), pg_atomic_read_u32(), and LWLock::state.
Referenced by LWLockDequeueSelf(), LWLockQueueSelf(), LWLockUpdateVar(), and LWLockWakeup().
Definition at line 891 of file lwlock.c.
References Assert, fb(), LW_FLAG_LOCKED, pg_atomic_fetch_and_u32(), PG_USED_FOR_ASSERTS_ONLY, and LWLock::state.
Referenced by LWLockDequeueSelf(), LWLockQueueSelf(), and LWLockUpdateVar().
Definition at line 904 of file lwlock.c.
References Assert, proclist_mutable_iter::cur, fb(), GetPGProcByNumber, LOG_LWDEBUG, LW_EXCLUSIVE, LW_FLAG_HAS_WAITERS, LW_FLAG_WAKE_IN_PROGRESS, LW_WAIT_UNTIL_FREE, LW_WS_NOT_WAITING, LW_WS_PENDING_WAKEUP, LW_WS_WAITING, LWLockWaitListLock(), PGPROC::lwWaiting, PGPROC::lwWaitMode, pg_atomic_compare_exchange_u32(), pg_atomic_read_u32(), pg_write_barrier, PGSemaphoreUnlock(), proclist_delete, proclist_foreach_modify, proclist_init(), proclist_is_empty(), proclist_push_tail, PGPROC::sem, LWLock::state, LWLock::waiters, and wakeup.
Referenced by LWLockRelease().
Definition at line 400 of file lwlock.c.
References fb(), foreach_ptr, and NamedLWLockTrancheRequests.
Referenced by LWLockShmemRequest().
Definition at line 620 of file lwlock.c.
References elog, ereport, errcode(), errdetail(), errmsg, ERROR, FATAL, fb(), foreach_ptr, IsPostmasterEnvironment, lappend(), list_length(), MAX_USER_DEFINED_TRANCHES, MemoryContextSwitchTo(), NAMEDATALEN, NamedLWLockTrancheRequests, palloc0(), PostmasterContext, process_shmem_requests_in_progress, strlcpy(), and TopMemoryContext.
Referenced by test_lwlock_tranches_shmem_request().
| StaticAssertDecl | ( | ((MAX_BACKENDS+1) &MAX_BACKENDS) | = =0, |
| "MAX_BACKENDS + 1 needs to be a power of 2" | |||
| ) |
| StaticAssertDecl | ( | (LW_VAL_EXCLUSIVE &LW_FLAG_MASK) | = =0, |
| "LW_VAL_EXCLUSIVE and LW_FLAG_MASK overlap" | |||
| ) |
| StaticAssertDecl | ( | (MAX_BACKENDS &LW_FLAG_MASK) | = =0, |
| "MAX_BACKENDS and LW_FLAG_MASK overlap" | |||
| ) |
| StaticAssertDecl | ( | lengthof(BuiltinTrancheNames) | = =LWTRANCHE_FIRST_USER_DEFINED, |
| "missing entries in BuiltinTrancheNames" | [] | ||
| ) |
Definition at line 137 of file lwlock.c.
Referenced by GetLWTrancheName().
|
static |
Definition at line 167 of file lwlock.c.
Referenced by LWLockAcquire(), LWLockAcquireOrWait(), LWLockAnyHeldByMe(), LWLockConditionalAcquire(), LWLockHeldByMe(), LWLockHeldByMeInMode(), LWLockRelease(), and LWLockReleaseAll().
|
static |
Definition at line 198 of file lwlock.c.
Referenced by GetLWTrancheName(), GetNamedLWLockTranche(), and LWLockNewTrancheId().
| const ShmemCallbacks LWLockCallbacks |
|
static |
Definition at line 195 of file lwlock.c.
Referenced by GetLWTrancheName(), GetNamedLWLockTranche(), LWLockNewTrancheId(), LWLockShmemInit(), and LWLockShmemRequest().
| LWLockPadded* MainLWLockArray = NULL |
Definition at line 150 of file lwlock.c.
Referenced by BufMappingPartitionLock(), BufMappingPartitionLockByIndex(), GetNamedLWLockTranche(), LWLockShmemInit(), and LWLockShmemRequest().
Definition at line 211 of file lwlock.c.
Referenced by LWLockShmemInit(), NumLWLocksForNamedTranches(), and RequestNamedLWLockTranche().
|
static |
Definition at line 166 of file lwlock.c.
Referenced by LWLockAcquire(), LWLockAcquireOrWait(), LWLockAnyHeldByMe(), LWLockConditionalAcquire(), LWLockHeldByMe(), LWLockHeldByMeInMode(), LWLockRelease(), and LWLockReleaseAll().
|
static |
Definition at line 214 of file lwlock.c.
Referenced by LWLockShmemInit(), and LWLockShmemRequest().