Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ae0897

Browse files
committed
Move TRACE calls into WaitOnLock()
LockAcquire is a long and complex function. Pushing more stuff to itssubroutines makes it a little more manageable.Reviewed-by: Maxim OrlovDiscussion:https://www.postgresql.org/message-id/7c2090cd-a72a-4e34-afaa-6dd2ef31440e@iki.fi
1 parent0464f25 commit6ae0897

File tree

1 file changed

+14
-15
lines changed
  • src/backend/storage/lmgr

1 file changed

+14
-15
lines changed

‎src/backend/storage/lmgr/lock.c‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,23 +1100,8 @@ LockAcquireExtended(const LOCKTAG *locktag,
11001100
* case, because while trying to go to sleep, we may discover that we
11011101
* can acquire the lock immediately after all.
11021102
*/
1103-
1104-
TRACE_POSTGRESQL_LOCK_WAIT_START(locktag->locktag_field1,
1105-
locktag->locktag_field2,
1106-
locktag->locktag_field3,
1107-
locktag->locktag_field4,
1108-
locktag->locktag_type,
1109-
lockmode);
1110-
11111103
WaitOnLock(locallock,owner,dontWait);
11121104

1113-
TRACE_POSTGRESQL_LOCK_WAIT_DONE(locktag->locktag_field1,
1114-
locktag->locktag_field2,
1115-
locktag->locktag_field3,
1116-
locktag->locktag_field4,
1117-
locktag->locktag_type,
1118-
lockmode);
1119-
11201105
/*
11211106
* NOTE: do not do any material change of state between here and
11221107
* return. All required changes in locktable state must have been
@@ -1860,6 +1845,13 @@ WaitOnLock(LOCALLOCK *locallock, ResourceOwner owner, bool dontWait)
18601845
LOCKMETHODIDlockmethodid=LOCALLOCK_LOCKMETHOD(*locallock);
18611846
LockMethodlockMethodTable=LockMethods[lockmethodid];
18621847

1848+
TRACE_POSTGRESQL_LOCK_WAIT_START(locallock->tag.lock.locktag_field1,
1849+
locallock->tag.lock.locktag_field2,
1850+
locallock->tag.lock.locktag_field3,
1851+
locallock->tag.lock.locktag_field4,
1852+
locallock->tag.lock.locktag_type,
1853+
locallock->tag.mode);
1854+
18631855
LOCK_PRINT("WaitOnLock: sleeping on lock",
18641856
locallock->lock,locallock->tag.mode);
18651857

@@ -1932,6 +1924,13 @@ WaitOnLock(LOCALLOCK *locallock, ResourceOwner owner, bool dontWait)
19321924

19331925
LOCK_PRINT("WaitOnLock: wakeup on lock",
19341926
locallock->lock,locallock->tag.mode);
1927+
1928+
TRACE_POSTGRESQL_LOCK_WAIT_DONE(locallock->tag.lock.locktag_field1,
1929+
locallock->tag.lock.locktag_field2,
1930+
locallock->tag.lock.locktag_field3,
1931+
locallock->tag.lock.locktag_field4,
1932+
locallock->tag.lock.locktag_type,
1933+
locallock->tag.mode);
19351934
}
19361935

19371936
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp