Daniel Eischen <[EMAIL PROTECTED]> wrote:
>Scott Hess mailto:[EMAIL PROTECTED] wrote:
> > When using -pthread on FreeBSD3.3 to build a multithreaded program, I
find
> > that signals are delivered to all threads (see attached program).
> > Specifically, if multiple threads are in blocking read calls, and a
signal
> > is handled, they will all receive -1 from the read and EINTR in errno.
>
> If you don't want all threads to see the signal(s), then you
> have to block the signal(s) in each thread.
I've checked further, and found that FreeBSD correctly handles blocking
signals on a per-thread basis. _But_, all threads still get EINTR when a
signal happens while they're in a blocking read.
I've attached the updated program that shows the correct delivery of the
signals, with system calls still being interrupted. [Sorry about the
attachment, but that seems the safest way to go about getting the file
delivered in usable fashion.]
Thanks,
scott
thread_EINTR.c