Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-10-20 08:49:34 +0400
committerChristopher Faylor <me@cgf.cx>2004-10-20 08:49:34 +0400
commit4082a9eb4a8dba965ce6e1bcc86ee24c0f437bd7 (patch)
tree29cbbd67cd2b0376e67c762cc137b8f214793fef /winsup/cygwin/select.cc
parentd134b48fd6f73f3d9b9d261103f0e4ecd0f9f6e1 (diff)
* select.cc (start_thread_socket): Remove attempt to delay reading of exitsock
or suffer occasional mysterious 60 second hangs. (socket_cleanup): Empty the exitsock here after the thread has terminated.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index b85e0bd56..30b19f786 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -1346,12 +1346,7 @@ start_thread_socket (select_record *me, select_stuff *stuff)
}
if (_my_tls.locals.exitsock != INVALID_SOCKET)
- {
- char buf[1];
- si->exitsock = _my_tls.locals.exitsock;
- select_printf ("read a byte from %p", si->exitsock);
- recv (si->exitsock, buf, 1, 0);
- }
+ si->exitsock = _my_tls.locals.exitsock;
else
{
si->exitsock = _my_tls.locals.exitsock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
@@ -1408,6 +1403,10 @@ socket_cleanup (select_record *, select_stuff *stuff)
select_printf ("sent a byte to the exit sock %p, res %d", _my_tls.locals.exitsock, res);
/* Wait for thread to go away */
si->thread->detach ();
+ /* empty the socket */
+ select_printf ("reading a byte from %p", si->exitsock);
+ res = recv (si->exitsock, buf, 1, 0);
+ select_printf ("recv returned %d", res);
stuff->device_specific_socket = NULL;
delete si;
}