pgsql: Fix Windows implementation of PGSemaphoreLock. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix Windows implementation of PGSemaphoreLock.
Date
Msg-id E1SSXIQ-0004Y6-U7@gemulon.postgresql.org
Whole thread Raw
List 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
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/1b48f6af315e9db89aaf43e8c8c9de903294fbdf

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


pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: pgsql: 9.2 release note updates from Peter Geoghegan
Next
From: Tom Lane
Date:
Subject: pgsql: Fix Windows implementation of PGSemaphoreLock.