[PATCH] Fix nanosleep

Thomas Pfaff tpfaff@gmx.net
Tue May 6 14:02:00 GMT 2003


Christopher Faylor wrote:
> I don't know what you're investigating but the basic problem with threads
> and signals is that you can't send a signal to a thread.  I never implemented
> that part of signal delivery.

Indeed you are right:

pthread_kill does not work as expected, instead of sending a signal to 
the specified thread all threads are woken up and the signal handler is 
not called in the context of that particular thread but in the context 
of the main thread. Since all threads are waiting for the same global 
signal_arrived and not for thread specific one it is clear that this 
does not work.

And i would like to know why every thread has its own sigaction 
structure. AFAIK signals are global in the process and not thread 
specific, and only the delivery to a thread can be blocked via 
pthread_sigmask.

Thomas



More information about the Cygwin-patches mailing list