File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -388,25 +388,27 @@ void MtmUnlock(void)
388
388
Assert (Mtm -> lastLockHolder == MyProcPid );
389
389
return ;
390
390
}
391
- if (MyProc == NULL ) { /* If we have no PGPROC, then lock was not obtained. */
392
- return ;
393
- }
391
+
394
392
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 ]);
396
397
}
397
398
398
399
void MtmDeepUnlock (void )
399
400
{
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 )
405
402
return ;
406
403
404
+ Assert (Mtm -> lastLockHolder == MyProcPid );
405
+
407
406
MtmLockCount = 0 ;
408
407
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 ]);
410
412
}
411
413
412
414
void MtmLockNode (int nodeId , LWLockMode mode )
You can’t perform that action at this time.
0 commit comments