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

Commit247bce7

Browse files
committed
Do not call LWLockRelease() in MtmDeepUnlock() when MtmLockCount == 0
1 parent5876bfd commit247bce7

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

‎multimaster.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -388,25 +388,27 @@ void MtmUnlock(void)
388388
Assert(Mtm->lastLockHolder==MyProcPid);
389389
return;
390390
}
391-
if (MyProc==NULL) {/* If we have no PGPROC, then lock was not obtained. */
392-
return;
393-
}
391+
394392
Mtm->lastLockHolder=0;
395-
LWLockRelease((LWLockId)&Mtm->locks[MTM_STATE_LOCK_ID]);
393+
394+
/* If we have no PGPROC, then lock was not obtained. */
395+
if (MyProc!=NULL)
396+
LWLockRelease((LWLockId)&Mtm->locks[MTM_STATE_LOCK_ID]);
396397
}
397398

398399
voidMtmDeepUnlock(void)
399400
{
400-
if (MtmLockCount>0)
401-
Assert(Mtm->lastLockHolder==MyProcPid);
402-
403-
/* If we have no PGPROC, then lock was not obtained. */
404-
if (MyProc==NULL)
401+
if (MtmLockCount==0)
405402
return;
406403

404+
Assert(Mtm->lastLockHolder==MyProcPid);
405+
407406
MtmLockCount=0;
408407
Mtm->lastLockHolder=0;
409-
LWLockRelease((LWLockId)&Mtm->locks[MTM_STATE_LOCK_ID]);
408+
409+
/* If we have no PGPROC, then lock was not obtained. */
410+
if (MyProc!=NULL)
411+
LWLockRelease((LWLockId)&Mtm->locks[MTM_STATE_LOCK_ID]);
410412
}
411413

412414
voidMtmLockNode(intnodeId,LWLockModemode)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp