Re: stopping a thread

[email protected] (Thomas S Brettin)
Newsgroups perl.ithreads
Message-ID <[email protected]>
wouldn't it be nice:

$thread->DESTROY

To stop a thread from outside the thread.

best,
tom


On Mon, 3 May 2004, Mike Pomraning wrote:

> On Sun, 2 May 2004, Thomas S Brettin wrote:
> 
> > Is there an easy way to stop a thread from outside the thread? I'ld like
> > to do something simple like:
> >
> > my $thread = threads->new($code_ref);
> > ...
> > $thread->stop();
> >
> > Thanks for any help.
> 
> There's no notion of 'thread cancellation' in perl.  If you can run
> Thread::Signal (see that module's CAVEATS), then Thread::Stop offers a kill()
> method which behaves as you expect.
> 
> -Mike
> 

-- 
Thomas Brettin
505-699-7540 (mobile)
505-665-3334 (office)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.