[44] in Pthreads mailing list archive
Re: Pthreads & GNAT
daemon@ATHENA.MIT.EDU (Ken Raeburn)
Thu Jul 13 17:31:32 1995
Date: Thu, 13 Jul 1995 17:13:26 -0400
From: Ken Raeburn <raeburn@cygnus.com>
To: Steven Hugg <hugg@xi.cs.fsu.edu>
Cc: pthreads@MIT.EDU
In-Reply-To: Steven Hugg's message of Thu, 13 Jul 1995 16:25:36 -0400 (EDT)
<199507132025.QAA24906@xi.cs.fsu.edu>
From: Steven Hugg <hugg@xi.cs.fsu.edu>
Date: Thu, 13 Jul 1995 16:25:36 -0400 (EDT)
:struct pthread_sigvec {
: void (*vector)();
: enum pthread_sig_flags {
: PTHREAD_SIG_IGN = (long)SIG_IGN,
: PTHREAD_SIG_DFL = (long)SIG_DFL,
: PTHREAD_SIG_SIGNAL
: }
:flags; } pthread_sigvec[SIGMAX];
Is is intentional that PTHREAD_SIG_DFL = PTHREAD_SIG_SIGNAL? They are the
same on my compiler (gcc 2.7.0).
I think you mean PTHREAD_SIG_IGN, not PTHREAD_SIG_DFL, don't you? In
all cases, PTHREAD_SIG_SIGNAL should be PTHREAD_SIG_DFL + 1, but if
SIG_IGN is 1 and SIG_DFL is 0 (which is the case on NetBSD, and I
presume Linux), then PTHREAD_SIG_SIGNAL will be 1 also.
Chris, you could probably use something like:
PTHREAD_SIG_SIGNAL = 1 + MAX ((long) SIG_IGN, (long) SIG_DFL)
to get around this.
Even better, decouple pthread_sig_flags from the SIG_* values
completely, and provide some code to translate values; that would be
cleaner. (Though if you reorder PTHREAD_SIG_IGN and PTHREAD_SIG_DFL
and start them at zero, then on these systems, the translation code
could still be reasonably efficient.)
Then you get to debug the PTHREAD_SIG_SIGNAL branches that haven't
been getting exercised. :-)
Ken