pgsql: Move some code blocks in lock.c and proc.c

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Move some code blocks in lock.c and proc.c
Date: 2026-03-24 04:35:42
Message-ID: E1w4tUT-001Bfi-1V@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Move some code blocks in lock.c and proc.c

This change will simplify an upcoming change that will introduce lock
statistics, reducting code churn.

This commit means that we begin to calculate the time it took to acquire
a lock after the deadlock check interrupt has run should log_lock_waits
be off, when taken in isolation. This is not a performance-critical
code path, and note that log_lock_waits is enabled by default since
2aac62be8cbb.

Extracted from a larger patch by the same author.

Author: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/aIyNxBWFCybgBZBS@ip-10-97-1-34.eu-west-3.compute.internal

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a90d86518243a077cdd1445ec8586ffb81dae408

Modified Files
--------------
src/backend/storage/lmgr/lock.c | 55 +++++++------
src/backend/storage/lmgr/proc.c | 176 +++++++++++++++++++++-------------------
2 files changed, 120 insertions(+), 111 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-03-24 06:33:02 pgsql: Add support for lock statistics in pgstats
Previous Message Michael Paquier 2026-03-23 23:30:42 pgsql: Make implementation of SASLprep compliant for ASCII characters