pgsql: Improve signal-handler lockout mechanism in timeout.c.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve signal-handler lockout mechanism in timeout.c.
Date: 2013-03-18 02:42:30
Message-ID: E1UHQ1u-0004vz-Fw@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve signal-handler lockout mechanism in timeout.c.

Rather than doing a fairly-expensive setitimer() call to prevent interrupts
from happening, let's just invent a simple boolean flag that the signal
handler is required to check. This is not only faster but considerably
more robust than before, since the previous code effectively assumed that
only ITIMER_REAL events would ever fire the SIGALRM handler, which is
obviously something that can be broken easily by third-party code.

Zoltán Böszörményi and Tom Lane

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6ac7facdd3990baf47efc124e9d7229422a06452

Modified Files
--------------
src/backend/utils/misc/timeout.c | 177 ++++++++++++++++++++++---------------
1 files changed, 105 insertions(+), 72 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2013-03-18 02:53:10 pgsql: Extend object-access hook machinery to support post-alter events
Previous Message Tom Lane 2013-03-17 20:09:54 pgsql: Use pqsignal() in contrib programs rather than calling signal(2)