1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-04 20:11:56 +03:00

Remove remnants of ImmediateInterruptOK handling.

Now that nothing sets ImmediateInterruptOK to true anymore, we can
remove all the supporting code.

Reviewed-By: Heikki Linnakangas
This commit is contained in:
Andres Freund
2015-02-03 23:25:47 +01:00
parent d06995710b
commit 2505ce0be0
7 changed files with 7 additions and 99 deletions

View File

@@ -412,7 +412,6 @@ errfinish(int dummy,...)
{
ErrorData *edata = &errordata[errordata_stack_depth];
int elevel;
bool save_ImmediateInterruptOK;
MemoryContext oldcontext;
ErrorContextCallback *econtext;
@@ -420,18 +419,6 @@ errfinish(int dummy,...)
CHECK_STACK_DEPTH();
elevel = edata->elevel;
/*
* Ensure we can't get interrupted while performing error reporting. This
* is needed to prevent recursive entry to functions like syslog(), which
* may not be re-entrant.
*
* Note: other places that save-and-clear ImmediateInterruptOK also do
* HOLD_INTERRUPTS(), but that should not be necessary here since we don't
* call anything that could turn on ImmediateInterruptOK.
*/
save_ImmediateInterruptOK = ImmediateInterruptOK;
ImmediateInterruptOK = false;
/*
* Do processing in ErrorContext, which we hope has enough reserved space
* to report an error.
@@ -463,10 +450,6 @@ errfinish(int dummy,...)
* itself be inside a holdoff section. If necessary, such a handler
* could save and restore InterruptHoldoffCount for itself, but this
* should make life easier for most.)
*
* Note that we intentionally don't restore ImmediateInterruptOK here,
* even if it was set at entry. We definitely don't want that on
* while doing error cleanup.
*/
InterruptHoldoffCount = 0;
QueryCancelHoldoffCount = 0;
@@ -573,15 +556,9 @@ errfinish(int dummy,...)
}
/*
* We reach here if elevel <= WARNING. OK to return to caller, so restore
* caller's setting of ImmediateInterruptOK.
*/
ImmediateInterruptOK = save_ImmediateInterruptOK;
/*
* But check for cancel/die interrupt first --- this is so that the user
* can stop a query emitting tons of notice or warning messages, even if
* it's in a loop that otherwise fails to check for interrupts.
* Check for cancel/die interrupt first --- this is so that the user can
* stop a query emitting tons of notice or warning messages, even if it's
* in a loop that otherwise fails to check for interrupts.
*/
CHECK_FOR_INTERRUPTS();
}