lock with openoffice build with libkse

Daniel Eischen eischen at pcnet.com
Thu May 29 13:56:49 PDT 2003


On Thu, 29 May 2003, Alexander Kabaev wrote:

> On Thu, 29 May 2003 16:29:23 -0400 (EDT)
> Daniel Eischen <eischen at pcnet.com> wrote:
> 
> > On Thu, 29 May 2003, Alexander Kabaev wrote:
> > 
> > > Daniel,
> > > 
> > > attached program is enough to trigger the loop. It looks like
> > > the setjump/longjmp from signal handler trick only forks for
> > > the first time.
> > 
> > You can try this patch.  It puts the cart before the horse
> > though, so signals could get delivered in a different
> > order.
> 
> Yuck :(. Shouldn't you just unblock this particular signal instead of
> setting the whole mask?

If it never returns from the handler (longjmp's out), then
the signal mask will never be correct.  You have to set the
mask back to what it would be if sigreturn() were called.

Ok, this fix should be better.

-- 
Dan Eischen

Index: thread/thr_sigprocmask.c
===================================================================
RCS file: /home/ncvs/src/lib/libpthread/thread/thr_sigprocmask.c,v
retrieving revision 1.13
diff -u -r1.13 thr_sigprocmask.c
--- thread/thr_sigprocmask.c	16 Sep 2002 08:45:36 -0000	1.13
+++ thread/thr_sigprocmask.c	29 May 2003 20:55:28 -0000
@@ -44,5 +44,8 @@
 int
 _sigprocmask(int how, const sigset_t *set, sigset_t *oset)
 {
-	return (pthread_sigmask(how, set, oset));
+	if (_kse_isthreaded() != 0)
+		return (pthread_sigmask(how, set, oset));
+	else
+		return (__sys_sigprocmask(how, set, oset));
 }




More information about the freebsd-threads mailing list