File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff 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
398399void MtmDeepUnlock (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
412414void MtmLockNode (int nodeId , LWLockMode mode )
You can’t perform that action at this time.
0 commit comments