Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit497d39d

Browse files
committed
prevent multiplexing Windows kernel event objects we listen for across various sockets - should fix the occasional stats test regression failures we see.
1 parent6dd2b77 commit497d39d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎src/backend/port/win32/socket.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.11 2006/03/05 15:58:35 momjian Exp $
9+
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.12 2006/07/29 19:55:18 adunstan Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -106,6 +106,7 @@ int
106106
pgwin32_waitforsinglesocket(SOCKETs,intwhat)
107107
{
108108
staticHANDLEwaitevent=INVALID_HANDLE_VALUE;
109+
staticSOCKETcurrent_socket=-1;
109110
HANDLEevents[2];
110111
intr;
111112

@@ -121,6 +122,15 @@ pgwin32_waitforsinglesocket(SOCKET s, int what)
121122
ereport(ERROR,
122123
(errmsg_internal("Failed to reset socket waiting event: %i", (int)GetLastError())));
123124

125+
/*
126+
* make sure we don't multiplex this kernel event object with a different
127+
* socket from a previous call
128+
*/
129+
130+
if (current_socket!=s&&current_socket!=-1)
131+
WSAEventSelect(current_socket,waitevent,0);
132+
133+
current_socket=s;
124134

125135
if (WSAEventSelect(s,waitevent,what)==SOCKET_ERROR)
126136
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp