First draft: rewrite of {get|set|swap}context(3)

David Xu davidxu at FreeBSD.org
Sun Aug 17 16:31:21 PDT 2003


On Monday 18 August 2003 07:12, Marcel Moolenaar wrote:
> On Mon, Aug 18, 2003 at 06:47:52AM +0800, David Xu wrote:
> > Then doesn't signal context in signal handler have a UCF_SIGMASK ?
>
> Yes.
>
> > void    (*__sa_sigaction)(int, struct __siginfo *, ucontext_t *ucp);
> > the context *ucp should have UCF_SIGMASK now.
>
> We never define uc_flags currently. We only copyout() uc_sigmask and
> uc_mcontext. Hence, the uc_flags field is garbage. As is the uc_stack
> field.
>
> > I think it should be UCF_NOSIGMASK. But for libkse, we really needn't
> > this kind of hack, because M:N thread in kernel always masks all signals,
> > you can always SIGFILLSET(&uc.uc_sigmask) before call set_context.
>
> I tried this, but it didn't fix mutex_d.

I can pass mutex_d if gettimeofday does not return -1, but it is strange
that gettimeofday can return -1 and errno is EFAULT.

so line 414 of mutex_d.c is asserted:
   assert (gettimeofday (&tv2, NULL) == 0);

David Xu



More information about the freebsd-threads mailing list