Re: Signals on Win32 (was RE: [HACKERS] [PATCHES] fork/exec patch) - Mailing list pgsql-hackers-win32

From Zeugswetter Andreas SB SD
Subject Re: Signals on Win32 (was RE: [HACKERS] [PATCHES] fork/exec patch)
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA496208E@m0114.s-mxs.net
Whole thread Raw
In response to Signals on Win32 (was RE: [HACKERS] [PATCHES] fork/exec patch)  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
List pgsql-hackers-win32
> > How about the typical answer on Windows ? Create an invisible Window
> > with an Event Handler and pass it a windows message ?
>
> The issue at hand is not how the signal is sent, but the behavior taken
> once it arrives.  Using messages bypasses the thread problem but
> requires PeekMessage() to be put in various places to check if there is
> a signal waiting to be acted on, which is really any easier then
> SleepEx(0), although, it does bypass the threading issues.

I think that is not correct.

            hWnd = CreateWindow ("STATIC", "", WS_POPUP, 0, 0, 0, 0,NULL,NULL,NULL,NULL);
            ShowWindow (hWnd, SW_HIDE);
        wpOrigProc = (WNDPROC) SetWindowLong(hWnd, GWL_WNDPROC, (LONG) pg_WinProc);

LRESULT APIENTRY pg_WinProc(
    HWND hwnd,
    UINT uMsg,
    WPARAM wParam,
    LPARAM lParam)
{
    MSG rMsg;

    rMsg.message = uMsg;
    rMsg.wParam = wParam;
    rMsg.lParam = lParam;

        // printf ("got message %d\n", rMsg.message);
    switch (rMsg.message)
    {
        case PG_SIGNAL_KILL:
    ......
}

Andreas

pgsql-hackers-win32 by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Signals on Win32 (was RE: [HACKERS] [PATCHES] fork/exec patch)
Next
From: "Merlin Moncure"
Date:
Subject: Re: Signals on Win32 (was RE: [HACKERS] [PATCHES] fork/exec patch)