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

Commit25b93a2

Browse files
committed
Remove obsolete comments about sempahores from proc.c.
Commit6753333 switched from a semaphore-based wait to a latch-basedwait for ProcSleep()/ProcWakeup(), but left behind some stray referencesto semaphores.Back-patch to 9.5.Reviewed-by: Daniel Gustafsson, Michael PaquierDiscussion:https://postgr.es/m/CA+hUKGLs5H6zhmgTijZ1OaJvC1sG0=AFXc1aHuce32tKiQrdEA@mail.gmail.com
1 parent20e1cc8 commit25b93a2

File tree

1 file changed

+6
-8
lines changed
  • src/backend/storage/lmgr

1 file changed

+6
-8
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,8 +1196,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
11961196

11971197
/*
11981198
* If we detected deadlock, give up without waiting. This must agree with
1199-
* CheckDeadLock's recovery code, except that we shouldn't release the
1200-
* semaphore since we haven't tried to lock it yet.
1199+
* CheckDeadLock's recovery code.
12011200
*/
12021201
if (early_deadlock)
12031202
{
@@ -1233,9 +1232,9 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
12331232

12341233
/*
12351234
* Set timer so we can wake up after awhile and check for a deadlock. If a
1236-
* deadlock is detected, the handlerreleases the process's semaphore and
1237-
*sets MyProc->waitStatus =STATUS_ERROR, allowing us to know that we
1238-
*must report failure ratherthan success.
1235+
* deadlock is detected, the handlersets MyProc->waitStatus =
1236+
* STATUS_ERROR, allowing us to know that we must report failure rather
1237+
* than success.
12391238
*
12401239
* By delaying the check until we've waited for a bit, we can avoid
12411240
* running the rather expensive deadlock-check code in most cases.
@@ -1578,7 +1577,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
15781577

15791578

15801579
/*
1581-
* ProcWakeup -- wake up a process byreleasing itsprivate semaphore.
1580+
* ProcWakeup -- wake up a process bysetting itslatch.
15821581
*
15831582
* Also remove the process from the wait queue and set its links invalid.
15841583
* RETURN: the next process in the wait queue.
@@ -1713,8 +1712,7 @@ CheckDeadLock(void)
17131712
* we know that we don't have to wait anymore.
17141713
*
17151714
* We check by looking to see if we've been unlinked from the wait queue.
1716-
* This is quicker than checking our semaphore's state, since no kernel
1717-
* call is needed, and it is safe because we hold the lock partition lock.
1715+
* This is safe because we hold the lock partition lock.
17181716
*/
17191717
if (MyProc->links.prev==NULL||
17201718
MyProc->links.next==NULL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp