Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Mar 2000 18:07:30 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        freebsd-stable@FreeBSD.ORG, tim@mysql.com
Subject:   Re: pthread_kill() not killing thread
Message-ID:  <200003242307.SAA08054@pcnet1.pcnet.com>

next in thread | raw e-mail | index | archive | help
Thimble Smith wrote:
> Hi.  I'm running 4.0-STABLE cvsup'd on Tuesday (21 Mar).  It
> looks like pthread_kill() isn't killing the thread; I could be
> doing something wrong, of course.  Here's the output of my test
> program:

[ ... ]

> The extra pthread_sigmask(SIG_UNBLOCK, &set) that is in test_body()
> doesn't make any difference.
> 
> Am I doing something wrong?  Or should I file a problem report?

My "interpretation" of the POSIX spec was that intra-process signals
sent via pthread_kill() were treated differently than if the signal was
sent to the process.  I'll have to go back and re-read the POSIX spec --
perhaps I misunderstood it.

At any rate, FreeBSDs threads implementation of pthread_kill() will
not have the same effect as kill(2) -- the process will not be terminated
by issuing a pthread_kill(thrd, SIGTERM) to a thread.  Signals sent
to threads via pthread_kill will invoke a signal handler if it is
installed and will interrupt the thread from its current operation
(returning -1 with EINTR).  This all assumes that the thread isn't
masking the signal, and that the handler isn't installed with SA_RESTART.

Other conflicting "views" of the POSIX spec are certainly welcome.
We will make every effort to conform to the spec.

Dan Eischen


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003242307.SAA08054>