diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3270764f7..5ba445c97 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +Mon Mar 19 17:43:29 2001 Christopher Faylor + + * exceptions.cc (interruptible): Update debugging output. + (setup_handler): Ensure that wait_sig loop wakes up when we punt on + sending a signal. + * poll.cc (poll): Add signal guard here. + 2001-03-19 Egor Duda * tty.h (tty::create_inuse): Add new parameter to allow non- diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index c0d88a815..0c138ef50 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -640,10 +640,8 @@ interruptible (DWORD pc, int testvalid = 0) else res = !strncasematch (windows_system_directory, checkdir, windows_system_directory_length); - minimal_printf ("h %p", h); # undef h - - minimal_printf ("interruptible %d", res); + sigproc_printf ("h %p, interruptible %d", res); return res; } @@ -856,11 +854,13 @@ setup_handler (int sig, void *handler, struct sigaction& siga) break; } -set_pending: + set_pending: if (!interrupted) { pending_signals = 1; /* FIXME: Probably need to be more tricky here */ sig_set_pending (sig); + sig_dispatch_pending (1); + Sleep (0); /* Hopefully, other process will be waking up soon. */ sigproc_printf ("couldn't send signal %d", sig); } else diff --git a/winsup/cygwin/poll.cc b/winsup/cygwin/poll.cc index d55b2af32..f3c9ef6d7 100644 --- a/winsup/cygwin/poll.cc +++ b/winsup/cygwin/poll.cc @@ -15,6 +15,7 @@ #include "fhandler.h" #include "dtable.h" #include "cygerrno.h" +#include "sigproc.h" extern "C" int @@ -23,6 +24,7 @@ poll (struct pollfd *fds, unsigned int nfds, int timeout) int max_fd = 0; fd_set *open_fds, *read_fds, *write_fds, *except_fds; struct timeval tv = { timeout / 1000, (timeout % 1000) * 1000 }; + sigframe thisframe (mainthread); for (unsigned int i = 0; i < nfds; ++i) if (fds[i].fd > max_fd) diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index d7a298514..18cb3c304 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -238,7 +238,7 @@ public: SemaphoreItem *GetSemaphore (sem_t * t); // Condition functions - CondItem *CreateCond (pthread_cond_t *, const pthread_condattr_t *); + CondItem *CreateCond (pthread_cond_t *, const pthread_condattr_t *); CondItem *GetCond (pthread_cond_t *); private: