aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_socket.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-12-04 17:58:24 +0000
committerChristopher Faylor <me@cgf.cx>2011-12-04 17:58:24 +0000
commit8f937028d9b8d387cf35b64d92056241bffabd78 (patch)
tree2ed73616733809fc902b1e33bc2370a0468ba142 /winsup/cygwin/fhandler_socket.cc
parent69864e48cb0ef1efd1ac29a80b34bbc9c604533b (diff)
downloadnewlib-8f937028d9b8d387cf35b64d92056241bffabd78.zip
newlib-8f937028d9b8d387cf35b64d92056241bffabd78.tar.gz
newlib-8f937028d9b8d387cf35b64d92056241bffabd78.tar.bz2
* exceptions.cc (exception::handle): Drop abbreviation for "exception" since I
never remember what it stands for. (sig_handle_tty_stop): Remove obsolete call to sig_handle_tty_stop. (_cygtls::call_signal_handler): Rework to grab signal information from _main_tls if none is set for _my_tls. Try harder to keep thread locked. (reset_signal_arrived): Delete. * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use new cygWFMO call to wait for an event + standard cygwin stuff. Modify debug output to acccomodate new function. * fhandler_console.cc (fhandler_console::read): Replace WaitForMultipleObjects with cygWFMO. * fhandler_socket.cc (get_inet_addr): Add comment. * gendef (_sigdelayed): Remove call to reset_signal_arrived. * sigproc.cc (_cygtls::signal_exit): Don't close my_readsig here unless we're in the signal thread. (create_signal_arrived): Create signal_arrived as auto-reset so that only one thread is woken when a signal arrives. * sigproc.h (cygWFMO): New function. (reset_signal_arrived): Delete declaration.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index fff1083..17d98dc 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -127,6 +127,8 @@ get_inet_addr (const struct sockaddr *in, int inlen,
some greedy Win32 application. Therefore we should never wait
endlessly without checking for signals and thread cancel event. */
pthread_testcancel ();
+ /* Using IsEventSignalled like this is racy since another thread could
+ be waiting for signal_arrived. */
if (IsEventSignalled (signal_arrived)
&& !_my_tls.call_signal_handler ())
{