[haiku-development] Re: kill thread?

  • From: Pete Goodeve <pete.goodeve@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 16 Aug 2012 19:30:16 -0700

On Thu, Aug 16, 2012 at 02:22:08PM +0200, Ingo Weinhold wrote:
> Pete Goodeve wrote:
> > Since when has 'kill <thread id>' not worked? ...And why?
> 
> I would say since hrev42116. The reason for this is that the semantics of 
> kill() has been fixed, which is what the kill command uses to send the 
> signal(s).
> 
> > I can kill a *team* by id, but if I just want to remove one of its 
> > sub-threads,
> > I get "no such process"!
> 
> There's process controller, if you want to actually kill the thread.

Umm.  How do you do that, exactly?  There's "Quit an Application", which only
presents the teams -- no way of getting at individual threads.  The "Threads..."
panel only lets you change priority.

> I believe sending other signals to threads is indeed not easily possible 
> anymore. If it is any consolation, it never was in BeOS.
>
Actually BeOS lets you send any signal to a thread -- it just always
terminates it (:-/)  [Maybe that's what you meant?]  And -- totally
undocumented -- the value returned by a wait_for_thread is the signal value!

Isn't the ability to send an 'out-of-band' notification to a thread
(waiting on a port or semaphore) somewhat important, though?  I think
I've wanted to do that in the past [and probably never succeeded due
to the above... (:-/)].  How do you do that without signals?

After pawing through documents and experiments all day, the only
way I've found to have the thread skip a held semaphore is via
"suspend; resume", which is hardly intuitive!  (And I see that the
BeBook says this is equivalent to 'SIGCONT', but it isn't either in Haiku
or BeOS!  That signal seems to be the only one just ignored.)

        -- Pete --


Other related posts: