summaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/sinval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/ipc/sinval.c')
-rw-r--r--src/backend/storage/ipc/sinval.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/backend/storage/ipc/sinval.c b/src/backend/storage/ipc/sinval.c
index d002f45489..c8d3a114c4 100644
--- a/src/backend/storage/ipc/sinval.c
+++ b/src/backend/storage/ipc/sinval.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.87 2008/12/09 14:28:20 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.88 2008/12/09 15:59:39 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,8 +26,8 @@
* Because backends sitting idle will not be reading sinval events, we
* need a way to give an idle backend a swift kick in the rear and make
* it catch up before the sinval queue overflows and forces it to go
- * through a cache reset exercise. This is done by sending
- * PROCSIG_CATCHUP_INTERRUPT to any backend that gets too far behind.
+ * through a cache reset exercise. This is done by sending SIGUSR1
+ * to any backend that gets too far behind.
*
* State for catchup events consists of two flags: one saying whether
* the signal handler is currently allowed to call ProcessCatchupEvent
@@ -144,9 +144,9 @@ ReceiveSharedInvalidMessages(
/*
- * HandleCatchupInterrupt
+ * CatchupInterruptHandler
*
- * This is called when PROCSIG_CATCHUP_INTERRUPT signal is received.
+ * This is the signal handler for SIGUSR1.
*
* If we are idle (catchupInterruptEnabled is set), we can safely
* invoke ProcessCatchupEvent directly. Otherwise, just set a flag
@@ -156,11 +156,13 @@ ReceiveSharedInvalidMessages(
* since there's no longer any reason to do anything.)
*/
void
-HandleCatchupInterrupt(void)
+CatchupInterruptHandler(SIGNAL_ARGS)
{
+ int save_errno = errno;
+
/*
- * Note: this is called by a SIGNAL HANDLER.
- * You must be very wary what you do here.
+ * Note: this is a SIGNAL HANDLER. You must be very wary what you do
+ * here.
*/
/* Don't joggle the elbow of proc_exit */
@@ -214,6 +216,8 @@ HandleCatchupInterrupt(void)
*/
catchupInterruptOccurred = 1;
}
+
+ errno = save_errno;
}
/*
@@ -285,8 +289,7 @@ DisableCatchupInterrupt(void)
/*
* ProcessCatchupEvent
*
- * Respond to a catchup event (PROCSIG_CATCHUP_INTERRUPT) from another
- * backend.
+ * Respond to a catchup event (SIGUSR1) from another backend.
*
* This is called either directly from the SIGUSR1 signal handler,
* or the next time control reaches the outer idle loop (assuming