mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
prevent multiplexing Windows kernel event objects we listen for across various sockets - should fix the occasional stats test regression failures we see.
This commit is contained in:
parent
271852a021
commit
e482136c04
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.10 2005/10/25 15:15:16 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.10.2.1 2006/07/29 20:00:00 adunstan Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -106,6 +106,7 @@ int
|
|||||||
pgwin32_waitforsinglesocket(SOCKET s, int what)
|
pgwin32_waitforsinglesocket(SOCKET s, int what)
|
||||||
{
|
{
|
||||||
static HANDLE waitevent = INVALID_HANDLE_VALUE;
|
static HANDLE waitevent = INVALID_HANDLE_VALUE;
|
||||||
|
static SOCKET current_socket = -1;
|
||||||
HANDLE events[2];
|
HANDLE events[2];
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -121,6 +122,15 @@ pgwin32_waitforsinglesocket(SOCKET s, int what)
|
|||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errmsg_internal("Failed to reset socket waiting event: %i", (int) GetLastError())));
|
(errmsg_internal("Failed to reset socket waiting event: %i", (int) GetLastError())));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* make sure we don't multiplex this with a different socket
|
||||||
|
* from a previous call
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (current_socket != s && current_socket != -1)
|
||||||
|
WSAEventSelect(current_socket, waitevent, 0);
|
||||||
|
|
||||||
|
current_socket = s;
|
||||||
|
|
||||||
if (WSAEventSelect(s, waitevent, what) == SOCKET_ERROR)
|
if (WSAEventSelect(s, waitevent, what) == SOCKET_ERROR)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user