* 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.
This commit is contained in:
Christopher Faylor 2004-10-20 04:49:34 +00:00
parent d134b48fd6
commit 4082a9eb4a
2 changed files with 12 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2004-10-20 Christopher Faylor <cgf@timesys.com>
* 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.
2004-10-19 Christopher Faylor <cgf@timesys.com>
* fhandler_console.cc (fhandler_console::fixup_after_exec): Fix error

View File

@ -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;
}