Mail Archives: cygwin-developers/1998/06/15/06:46:33
>From: Sergey Okhapkin <sos AT prospect DOT com DOT ru>
>Date: Mon, 15 Jun 1998 17:26:26 +0400
>
>Christopher Faylor wrote:
>> >> void
>> >> killme(int sig)
>> >> {
>> >> exit(sig);
>> >> }
>> >>
>> >> int
>> >> main(int argc, char **argv)
>> >> {
>> >> signal(SIGALRM, killme);
>> >> alarm(5);
>> >> pause();
>> >> }
>> >>
>> Sergey, once again - I'm pointing out that it is still possible to hang
>> cygwin with something like the above. You proposed a solution. I have
>
>How this example may hang if sig_handle() will call do_exit() for
>uncatched signal (SIGINT, for example)?
Gee, I don't know. I guess it won't. If do_exit was called in the
context of the signal thread and WSA_CLEANUP wasn't called, the program
would just exit.
Now that I answered your question, how about answering this one: Imagine
that, instead of a pause() the program was doing a blocking socket
operation that lasted at least 10 seconds. What would happen when the
SIGALRM occurred?
cgf
- Raw text -