* net.cc (wsock_init): Rename `was_in_progress' to `wsock_started'

for clearness.
This commit is contained in:
Corinna Vinschen 2001-05-03 16:18:51 +00:00
parent 70c7f359b1
commit 6c22ecdd32
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Thu May 3 18:16:00 2001 Corinna Vinschen <corinna@vinschen.de>
* net.cc (wsock_init): Rename `was_in_progress' to `wsock_started'
for clearness.
Thu May 3 10:44:16 2001 Christopher Faylor <cgf@cygnus.com> Thu May 3 10:44:16 2001 Christopher Faylor <cgf@cygnus.com>
* exceptions.cc (handle_exceptions): Break out of "loop" if the * exceptions.cc (handle_exceptions): Break out of "loop" if the

View File

@ -1929,14 +1929,14 @@ extern "C" void
wsock_init () wsock_init ()
{ {
static LONG NO_COPY here = -1L; static LONG NO_COPY here = -1L;
static int NO_COPY was_in_progress = 0; static int NO_COPY wsock_started = 0;
while (InterlockedIncrement (&here)) while (InterlockedIncrement (&here))
{ {
InterlockedDecrement (&here); InterlockedDecrement (&here);
Sleep (0); Sleep (0);
} }
if (!was_in_progress && (wsock32_handle || ws2_32_handle)) if (!wsock_started && (wsock32_handle || ws2_32_handle))
{ {
/* Don't use autoload to load WSAStartup to eliminate recursion. */ /* Don't use autoload to load WSAStartup to eliminate recursion. */
int (*wsastartup) (int, WSADATA *); int (*wsastartup) (int, WSADATA *);
@ -1957,7 +1957,7 @@ wsock_init ()
debug_printf ("iMaxUdpDg %d", wsadata.iMaxUdpDg); debug_printf ("iMaxUdpDg %d", wsadata.iMaxUdpDg);
debug_printf ("lpVendorInfo %d", wsadata.lpVendorInfo); debug_printf ("lpVendorInfo %d", wsadata.lpVendorInfo);
was_in_progress = 1; wsock_started = 1;
} }
} }
InterlockedDecrement (&here); InterlockedDecrement (&here);