* cygtls.h (exitsock): New element.

(exitsock_sin): Ditto.
* cygtls.cc (_cygtls::init_thread): Initialize exitsock to invalid handle.
(_cygtls::call2): Close exitsock if it is valid.
* select.cc (struct socketinf): Remove sin element.
(start_thread_socket): Initialize one SOCK_DGRAM socket per thread instead of
(apparently) expensive opening and closing of socket with each select call.
(socket_cleanup): Send a byte to the exitsock socket as a way to potentially
signal a waiting-for-socket thread to exit.
* tlsoffsets.h: Regenerate.
This commit is contained in:
Christopher Faylor
2004-10-11 02:21:31 +00:00
parent 8d712c8c3e
commit 1cda132258
5 changed files with 137 additions and 127 deletions

View File

@@ -16,6 +16,8 @@ details. */
#define _NOMNTENT_FUNCS
#include <mntent.h>
#undef _NOMNTENT_FUNCS
#define USE_SYS_TYPES_FD_SET
#include <winsock.h>
#define CYGTLS_INITIALIZED 0x43227
#define CYGTLS_EXCEPTION (0x43227 + true)
@@ -61,6 +63,10 @@ struct _local_storage
char mnt_fsname[CYG_MAX_PATH];
char mnt_dir[CYG_MAX_PATH];
/* select.cc */
SOCKET exitsock;
struct sockaddr_in exitsock_sin;
/* strerror */
char strerror_buf[20];