]> granicus.if.org Git - postgresql/commit
Fix Windows implementation of PGSemaphoreLock.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 10 May 2012 17:36:23 +0000 (13:36 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 10 May 2012 17:36:23 +0000 (13:36 -0400)
commitb149d1f90e7d42f719babc0c26addaeffa18df8c
tree485399ac6b56d8720e19ec56032a0a7aedf01a0d
parent5a96a0a8cf8cea3c5737fec9d37a75f012302f60
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.
src/backend/port/win32_sema.c