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

Commitf7aebd7

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 parent6dfc946 commitf7aebd7

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
@@ -1179,8 +1179,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
11791179

11801180
/*
11811181
* If we detected deadlock, give up without waiting. This must agree with
1182-
* CheckDeadLock's recovery code, except that we shouldn't release the
1183-
* semaphore since we haven't tried to lock it yet.
1182+
* CheckDeadLock's recovery code.
11841183
*/
11851184
if (early_deadlock)
11861185
{
@@ -1216,9 +1215,9 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
12161215

12171216
/*
12181217
* Set timer so we can wake up after awhile and check for a deadlock. If a
1219-
* deadlock is detected, the handlerreleases the process's semaphore and
1220-
*sets MyProc->waitStatus =STATUS_ERROR, allowing us to know that we
1221-
*must report failure ratherthan success.
1218+
* deadlock is detected, the handlersets MyProc->waitStatus =
1219+
* STATUS_ERROR, allowing us to know that we must report failure rather
1220+
* than success.
12221221
*
12231222
* By delaying the check until we've waited for a bit, we can avoid
12241223
* running the rather expensive deadlock-check code in most cases.
@@ -1561,7 +1560,7 @@ ProcSleep(LOCALLOCK *locallock, LockMethod lockMethodTable)
15611560

15621561

15631562
/*
1564-
* ProcWakeup -- wake up a process byreleasing itsprivate semaphore.
1563+
* ProcWakeup -- wake up a process bysetting itslatch.
15651564
*
15661565
* Also remove the process from the wait queue and set its links invalid.
15671566
* RETURN: the next process in the wait queue.
@@ -1696,8 +1695,7 @@ CheckDeadLock(void)
16961695
* we know that we don't have to wait anymore.
16971696
*
16981697
* We check by looking to see if we've been unlinked from the wait queue.
1699-
* This is quicker than checking our semaphore's state, since no kernel
1700-
* call is needed, and it is safe because we hold the lock partition lock.
1698+
* This is safe because we hold the lock partition lock.
17011699
*/
17021700
if (MyProc->links.prev==NULL||
17031701
MyProc->links.next==NULL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp