pgsql: Fix Windows implementation of PGSemaphoreLock.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix Windows implementation of PGSemaphoreLock.
Date: 2012-05-10 17:36:59
Message-ID: E1SSXIR-0004YD-1g@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix Windows implementation of PGSemaphoreLock.

The original coding failed to reset ImmediateInterruptOK before returning,
which would potentially allow a subsequent query-cancel interrupt to be
accepted at an unsafe point. This is a really nasty bug since it's so hard
to predict the consequences, but they could be unpleasant.

Also, ensure that signal handlers are serviced before this function
returns, even if the semaphore is already set. This should make the
behavior more like Unix.

Back-patch to all supported versions.

Branch
------
REL8_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/fcc0ba313b41437b9efc01438f133feb484b2e93

Modified Files
--------------
src/backend/port/win32_sema.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2012-05-10 17:38:17 pgsql: 9.2 release note updates from Peter Geoghegan
Previous Message Tom Lane 2012-05-10 17:36:58 pgsql: Fix Windows implementation of PGSemaphoreLock.