* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/port/win32/sema.c,v 1.8 2004/08/29 05:06:46 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/port/win32/sema.c,v 1.9 2004/09/07 14:31:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
wh[0] = cur_handle;
wh[1] = pgwin32_signal_event;
- ret = WaitForMultipleObjects(2, wh, FALSE, (sops[0].sem_flg & IPC_NOWAIT) ? 0 : INFINITE);
+ ret = WaitForMultipleObjectsEx(2, wh, FALSE, (sops[0].sem_flg & IPC_NOWAIT) ? 0 : INFINITE, TRUE);
if (ret == WAIT_OBJECT_0)
{
sem_counts[sops[0].sem_num]--;
return 0;
}
- else if (ret == WAIT_OBJECT_0 + 1)
+ else if (ret == WAIT_OBJECT_0 + 1 || ret == WAIT_IO_COMPLETION)
{
/* Signal event is set - we have a signal to deliver */
pgwin32_dispatch_queued_signals();
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.5 2004/08/30 02:54:38 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.6 2004/09/07 14:31:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
static int
pgwin32_poll_signals(void)
{
- if (WaitForSingleObject(pgwin32_signal_event, 0) == WAIT_OBJECT_0)
+ if (WaitForSingleObjectEx(pgwin32_signal_event, 0, TRUE) == WAIT_OBJECT_0)
{
pgwin32_dispatch_queued_signals();
errno = EINTR;
events[0] = pgwin32_signal_event;
events[1] = waitevent;
- r = WaitForMultipleObjects(2, events, FALSE, INFINITE);
+ r = WaitForMultipleObjectsEx(2, events, FALSE, INFINITE, TRUE);
- if (r == WAIT_OBJECT_0)
+ if (r == WAIT_OBJECT_0 || r == WAIT_IO_COMPLETION)
{
pgwin32_dispatch_queued_signals();
errno = EINTR;
}
events[numevents] = pgwin32_signal_event;
- r = WaitForMultipleObjectsEx(numevents + 1, events, FALSE, timeoutval, FALSE);
- if (r != WSA_WAIT_TIMEOUT && r != (WAIT_OBJECT_0 + numevents))
+ r = WaitForMultipleObjectsEx(numevents + 1, events, FALSE, timeoutval, TRUE);
+ if (r != WAIT_TIMEOUT && r != WAIT_IO_COMPLETION && r != (WAIT_OBJECT_0 + numevents))
{
/*
* We scan all events, even those not signalled, in case more than