MCPcopy Create free account
hub / github.com/apache/cloudberry / SwitchToSharedLatch

Function SwitchToSharedLatch

src/backend/utils/init/miscinit.c:206–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void
207SwitchToSharedLatch(void)
208{
209 Assert(MyLatch == &LocalLatchData);
210 Assert(MyProc != NULL);
211
212 MyLatch = &MyProc->procLatch;
213
214 if (FeBeWaitSet)
215 ModifyWaitEvent(FeBeWaitSet, FeBeWaitSetLatchPos, WL_LATCH_SET,
216 MyLatch);
217
218 /*
219 * Set the shared latch as the local one might have been set. This
220 * shouldn't normally be necessary as code is supposed to check the
221 * condition before waiting for the latch, but a bit care can't hurt.
222 */
223 SetLatch(MyLatch);
224}
225
226void
227SwitchBackToLocalLatch(void)

Callers 2

InitProcessFunction · 0.85
InitAuxiliaryProcessFunction · 0.85

Calls 2

ModifyWaitEventFunction · 0.85
SetLatchFunction · 0.85

Tested by

no test coverage detected