1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-21 02:52:47 +03:00

Introduce symbolic names for FeBeWaitSet positions.

Previously we used 0 and 1 to refer to the socket and latch in far flung
parts of the tree, without any explanation.  Also use PGINVALID_SOCKET
rather than -1 in a couple of places that didn't already do that.

Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/CA%2BhUKGJAC4Oqao%3DqforhNey20J8CiG2R%3DoBPqvfR0vOJrFysGw%40mail.gmail.com
This commit is contained in:
Thomas Munro
2021-03-01 15:16:56 +13:00
parent cf54e04b9e
commit a042ba2ba7
4 changed files with 24 additions and 7 deletions

View File

@@ -202,7 +202,8 @@ SwitchToSharedLatch(void)
MyLatch = &MyProc->procLatch;
if (FeBeWaitSet)
ModifyWaitEvent(FeBeWaitSet, 1, WL_LATCH_SET, MyLatch);
ModifyWaitEvent(FeBeWaitSet, FeBeWaitSetLatchPos, WL_LATCH_SET,
MyLatch);
/*
* Set the shared latch as the local one might have been set. This
@@ -221,7 +222,8 @@ SwitchBackToLocalLatch(void)
MyLatch = &LocalLatchData;
if (FeBeWaitSet)
ModifyWaitEvent(FeBeWaitSet, 1, WL_LATCH_SET, MyLatch);
ModifyWaitEvent(FeBeWaitSet, FeBeWaitSetLatchPos, WL_LATCH_SET,
MyLatch);
SetLatch(MyLatch);
}