Re: [PATCHES] win32 signals, part 5

Started by Magnus Haganderover 22 years ago3 messagespatches
Jump to latest
#1Magnus Hagander
magnus@hagander.net

Taking into account Claudios comments on the previous patch,

as well as

some more fooling around here of my own, here's a fourth

(and final?)

one.

Actually, please hold just a second :-)

I have an updated version of this patch that fixes the remaining small
issue (FATAL on failure to set the control handler). Will post later
tonight or early tomorrow. Only veyr small changes, so if there are no
objections to this one, there shouldn't be to that one either.

Here's the new one. Turns out I had already fixed the one part I thought
I still had, so it was already ready.

Changes since last patch:

1) Error messages in pgwin32_signal_initialize() are now all using
ereport(). (Previously used fprintf to stderr, but I realised that this
function executes on the main thread and can thus use ereport). The
error for SetConsoleCtrlHandler() is now FATAL, per suggestion from
Claudio.

2) Redefines CHECK_FOR_INTERRUPTS() on Win32 only, to include a call to
WaitForSingleObjectEx(). This allows our signals to be delivered just
before we check for their result. WIth this change, query cancel now
works fine on win32. It's also possible to do an "administrator
shutdown" on a backend that is running a query (previously only possible
when the backend was idle)

The rest is identical to patch _4.

//Magnus

#2Magnus Hagander
magnus@hagander.net
In reply to: Magnus Hagander (#1)

Actually, it seems I forgot to attach the actual patch *again*. Sheesh.
Here goes.

//Magnus

Show quoted text

Here's the new one. Turns out I had already fixed the one part
I thought
I still had, so it was already ready.

Changes since last patch:

1) Error messages in pgwin32_signal_initialize() are now all using
ereport(). (Previously used fprintf to stderr, but I realised that this
function executes on the main thread and can thus use ereport). The
error for SetConsoleCtrlHandler() is now FATAL, per suggestion from
Claudio.

2) Redefines CHECK_FOR_INTERRUPTS() on Win32 only, to include a call to
WaitForSingleObjectEx(). This allows our signals to be delivered just
before we check for their result. WIth this change, query cancel now
works fine on win32. It's also possible to do an "administrator
shutdown" on a backend that is running a query (previously
only possible
when the backend was idle)

The rest is identical to patch _4.

//Magnus

---------------------------(end of
broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org

Attachments:

win32_signals_5.patchapplication/octet-stream; name=win32_signals_5.patchDownload+237-205
#3Bruce Momjian
bruce@momjian.us
In reply to: Magnus Hagander (#1)

This patch has been applied by Neil.

---------------------------------------------------------------------------

Magnus Hagander wrote:

Taking into account Claudios comments on the previous patch,

as well as

some more fooling around here of my own, here's a fourth

(and final?)

one.

Actually, please hold just a second :-)

I have an updated version of this patch that fixes the remaining small
issue (FATAL on failure to set the control handler). Will post later
tonight or early tomorrow. Only veyr small changes, so if there are no
objections to this one, there shouldn't be to that one either.

Here's the new one. Turns out I had already fixed the one part I thought
I still had, so it was already ready.

Changes since last patch:

1) Error messages in pgwin32_signal_initialize() are now all using
ereport(). (Previously used fprintf to stderr, but I realised that this
function executes on the main thread and can thus use ereport). The
error for SetConsoleCtrlHandler() is now FATAL, per suggestion from
Claudio.

2) Redefines CHECK_FOR_INTERRUPTS() on Win32 only, to include a call to
WaitForSingleObjectEx(). This allows our signals to be delivered just
before we check for their result. WIth this change, query cancel now
works fine on win32. It's also possible to do an "administrator
shutdown" on a backend that is running a query (previously only possible
when the backend was idle)

The rest is identical to patch _4.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073