Skip to content

Conversation

@bizwark
Copy link
Contributor

@bizwark bizwark commented Apr 21, 2025

No description provided.

@bizwark bizwark requested a review from hlinnaka April 21, 2025 13:39
Comment on lines +170 to +185
unsafe {
let mask = pg_sys::WL_EXIT_ON_PM_DEATH | pg_sys::WL_LATCH_SET;
let my_latch = &mut (*pg_sys::MyProc).procLatch as *mut pg_sys::Latch;
let events = pg_sys::WaitLatch(
my_latch,
mask as i32,
0,
pg_sys::PG_WAIT_EXTENSION,
);
pg_sys::ResetLatch(my_latch);

if (events & pg_sys::WL_EXIT_ON_PM_DEATH as i32) != 0 {
// postmaster died
pg_sys::proc_exit(1);
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use pgrx's wait_latch function for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants