From owner-freebsd-stable Fri Mar 24 15: 8:25 2000 Delivered-To: freebsd-stable@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id CD8DB37B796 for ; Fri, 24 Mar 2000 15:08:18 -0800 (PST) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id SAA08054; Fri, 24 Mar 2000 18:07:30 -0500 (EST) Date: Fri, 24 Mar 2000 18:07:30 -0500 (EST) From: Daniel Eischen Message-Id: <200003242307.SAA08054@pcnet1.pcnet.com> To: freebsd-stable@FreeBSD.ORG, tim@mysql.com Subject: Re: pthread_kill() not killing thread Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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