aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 1ecaba0d574..4bec40aa287 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -146,11 +146,6 @@ static bool doing_extended_query_message = false;
static bool ignore_till_sync = false;
/*
- * Flag to keep track of whether statement timeout timer is active.
- */
-static bool stmt_timeout_active = false;
-
-/*
* If an unnamed prepared statement exists, it's stored here.
* We keep it separate from the hashtable kept by commands/prepare.c
* in order to reduce overhead for short-lived queries.
@@ -4029,7 +4024,6 @@ PostgresMain(int argc, char *argv[],
*/
disable_all_timeouts(false);
QueryCancelPending = false; /* second to avoid race condition */
- stmt_timeout_active = false;
/* Not reading from the client anymore. */
DoingCommandRead = false;
@@ -4711,14 +4705,14 @@ enable_statement_timeout(void)
if (StatementTimeout > 0)
{
- if (!stmt_timeout_active)
- {
+ if (!get_timeout_active(STATEMENT_TIMEOUT))
enable_timeout_after(STATEMENT_TIMEOUT, StatementTimeout);
- stmt_timeout_active = true;
- }
}
else
- disable_timeout(STATEMENT_TIMEOUT, false);
+ {
+ if (get_timeout_active(STATEMENT_TIMEOUT))
+ disable_timeout(STATEMENT_TIMEOUT, false);
+ }
}
/*
@@ -4727,10 +4721,6 @@ enable_statement_timeout(void)
static void
disable_statement_timeout(void)
{
- if (stmt_timeout_active)
- {
+ if (get_timeout_active(STATEMENT_TIMEOUT))
disable_timeout(STATEMENT_TIMEOUT, false);
-
- stmt_timeout_active = false;
- }
}